Sha256: 99ef4d5e59e145e9b1dfa6fd8f7eb78db5ff60f5dc704f5d534ca85e0298371c

Contents?: true

Size: 637 Bytes

Versions: 2

Compression:

Stored size: 637 Bytes

Contents

module AbAdmin
  module CarrierWave
    module Glue
      extend ActiveSupport::Concern

      module ClassMethods
        def ab_admin_uploader(uploader=nil, options={}, &block)
          options.reverse_merge!(mount_on: :data_file_name)
          options.merge!(validate_integrity: false, validate_processing: false, validate_download: false) unless uploader.try!(:enable_processing)
          
          mount_uploader(:data, uploader, options, &block)
        end

        def validates_filesize_of(*attr_names)
          validates_with FileSizeValidator, _merge_attributes(attr_names)
        end
      end
      
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ab_admin-0.11.0 lib/ab_admin/carrierwave/glue.rb
ab_admin-0.10.0 lib/ab_admin/carrierwave/glue.rb