Sha256: cc1283e6f2880a567274f0ab72ff56daafd777b18ee133aed99c21f7f8caafee
Contents?: true
Size: 586 Bytes
Versions: 18
Compression:
Stored size: 586 Bytes
Contents
class Photo < ActiveRecord::Base validates_attachment :image, :presence => true, :size => { :in => 0..2.megabytes } has_attached :image, :styles => { :large => ["800x600", :jpeg], :thumb => ["100x100", :jpeg] } acts_as_taggable validates_presence_of :photographable belongs_to :photographable, :polymorphic => :true delegate :url, :file_name, :to => :image field :caption, :text def owner photographable.owner if photographable && photographable.respond_to?(:owner) end timestamps def to_label image_file_name end end
Version data entries
18 entries across 18 versions & 1 rubygems