Sha256: 1ad88e27a31f5f47c2c5b922e5d1c6303fc69d826699986e05f78ab72ca41213

Contents?: true

Size: 767 Bytes

Versions: 4

Compression:

Stored size: 767 Bytes

Contents

# encoding: utf-8
module AbAdmin
  module CarrierWave
    module Glue
      extend ActiveSupport::Concern

      module ClassMethods
        def ab_admin_uploader(uploader=nil, options={}, &block)
          options = { mount_on: :data_file_name }.merge(options)
          
          mount_uploader(:data, uploader, options, &block)
          
          validates_processing_of :data
        end

        def sunrise_uploader(*args)
          ActiveSupport::Deprecation.warn('`sunrise_uploader` is deprecated, use `ab_admin_uploader` instead')
          ab_admin_uploader(*args)
        end
        
        def validates_filesize_of(*attr_names)
          validates_with FileSizeValidator, _merge_attributes(attr_names)
        end
      end
      
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ab_admin-0.6.1 lib/ab_admin/carrierwave/glue.rb
ab_admin-0.6.0 lib/ab_admin/carrierwave/glue.rb
ab_admin-0.5.0 lib/ab_admin/carrierwave/glue.rb
ab_admin-0.4.0 lib/ab_admin/carrierwave/glue.rb