Sha256: c9038b412a546798d0fb84347574c421ee04087b5c4ffede6845307c44c70848
Contents?: true
Size: 1.61 KB
Versions: 1
Compression:
Stored size: 1.61 KB
Contents
class ValidationUpload < ActiveRecord::Base attr_accessible :file_presence, :file_content_type, :file_size, :file_all, :image_presence, :image_content_type, :image_size, :image_all attached_file :file_presence, :file_content_type, :file_size, :file_all attached_file :file_default, :default => 'file.txt' attached_image :image_presence, :image_content_type, :image_size, :image_all, :presets => [:big] attached_image :image_default, :presets => [:big, :small], :default => 'assets/image.jpg' validates :file_presence, :attachment_presence => true validates :file_content_type, :attachment_content_type => { :in => ['txt'] } validates :file_size, :attachment_size => { :less_than => 15.kilobytes, :greater_than => 10.bytes } validates :file_all, :attachment_presence => true, :attachment_content_type => { :in => ['txt'] }, :attachment_size => { :less_than => 15.kilobytes, :greater_than => 10.bytes } validates :file_default, :attachment_presence => true, :attachment_content_type => { :in => ['txt'] }, :attachment_size => { :less_than => 15.kilobytes, :greater_than => 10.bytes } validates :image_presence, :attachment_presence => true validates :image_content_type, :attachment_content_type => { :in => ['jpg'] } validates :image_size, :attachment_size => { :in => 2.kilobytes..60.kilobytes } validates :image_all, :attachment_presence => true, :attachment_content_type => { :in => ['jpg'] }, :attachment_size => { :in => 2.kilobytes..60.kilobytes } validates :image_default, :attachment_presence => true, :attachment_content_type => { :in => ['jpg'] }, :attachment_size => { :in => 2.kilobytes..60.kilobytes } end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rails_uploads-0.1.4 | test/dummy/app/models/validation_upload.rb |