Skip to content

Instantly share code, notes, and snippets.

@skateman
Created April 26, 2018 09:31
Show Gist options
  • Save skateman/c36c2ee62b21ae45a3383980ac36c5be to your computer and use it in GitHub Desktop.
Save skateman/c36c2ee62b21ae45a3383980ac36c5be to your computer and use it in GitHub Desktop.
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