Created
April 26, 2018 09:31
-
-
Save skateman/c36c2ee62b21ae45a3383980ac36c5be to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
path = File.join(ManageIQ::UI::Classic.root, 'app', 'assets', 'images', '100', '*.png') | |
pngs = Dir.glob(path).map { |f| File.basename(f, '.png') } | |
Rails.application.eager_load! | |
models = ApplicationRecord.descendants.reject { |m| m.decorate && (m.decorate.fonticon || m.decorate.fileicon) }.reject do |m| | |
ret = nil | |
# Some records aren't that easy to create | |
begin | |
record = m.new | |
ret = record.decorate && (record.decorate.fonticon || record.decorate.fileicon) | |
rescue | |
ret = nil | |
end | |
ret | |
end | |
undecorated = models.map { |m| File.basename(m.to_s.underscore) } & pngs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment