Module: AbAdmin::Concerns::AssetHumanNames

Extended by:
ActiveSupport::Concern
Defined in:
lib/ab_admin/concerns/asset_human_names.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#make_asset_human_namesObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/ab_admin/concerns/asset_human_names.rb', line 14

def make_asset_human_names
  asset_human_names_list.each do |assoc|
    Array(send(assoc)).each do |asset|
      begin
        asset.store_model_filename(self)
      rescue Errno::ENOENT => e
        if Rails.env.production? && (defined? ExceptionNotifier)
          ExceptionNotifier.notify_exception(e, data: {email: asset.attributes})
        else
          raise e
        end
      end
    end
  end
end