Sha256: 847434d4b35608241761d2c09ca0bfac0e85179cfbc3be6b5b3475cbaf64ace9

Contents?: true

Size: 571 Bytes

Versions: 1

Compression:

Stored size: 571 Bytes

Contents

module AbAdmin
  module Concerns
    module AssetHumanNames
      extend ActiveSupport::Concern

      module ClassMethods
        def asset_human_names(*args)
          class_attribute :asset_human_names_list, instance_writer: false
          after_save :make_asset_human_names
          self.asset_human_names_list = args
        end
      end

      def make_asset_human_names
        asset_human_names_list.each do |assoc|
          Array(send(assoc)).each do |asset|
            asset.store_model_filename(self)
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ab_admin-0.4.0 lib/ab_admin/concerns/asset_human_names.rb