Module: Sunrise::CarrierWave::Glue::ClassMethods

Defined in:
lib/sunrise/carrier_wave/glue.rb

Instance Method Summary collapse

Instance Method Details

#sunrise_uploader(uploader = nil, options = {}, &block) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/sunrise/carrier_wave/glue.rb', line 11

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

#validates_filesize_of(*attr_names) ⇒ Object



19
20
21
# File 'lib/sunrise/carrier_wave/glue.rb', line 19

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