Sha256: faaf73ed3d02ea0ff6e0e06d74c9ee1c8732473d30ca69e2e2c2eb8e7dfca101
Contents?: true
Size: 1.25 KB
Versions: 24
Compression:
Stored size: 1.25 KB
Contents
class Picture < Asset # === List of columns === # id : integer # parent_id : integer # content_type : string # filename : string # thumbnail : string # size : integer # width : integer # height : integer # type : string # user_id : integer # assetable_id : integer # assetable_type : string # created_at : datetime # updated_at : datetime # ======================= belongs_to :user has_attachment :content_type => :image, :storage => :file_system, :path_prefix => 'public/attachments/pictures', :max_size => 2.megabytes, :size => 0.kilobytes..2000.kilobytes, :processor => 'Rmagick', :thumbnails => { :content => '575>', :thumb => '100x100!' } validates_as_attachment named_scope :masters, :conditions=>"parent_id IS NULL", :order=>'filename' def url_content public_filename(:content) end def url_thumb public_filename(:thumb) end def to_json(options = {}) options[:methods] ||= [] options[:methods] << :url_content options[:methods] << :url_thumb super options end end
Version data entries
24 entries across 24 versions & 5 rubygems