Sha256: a5008038a1fd291a7a7bdd0bce5bac9922dcc4992f1836efb696639b140acf58

Contents?: true

Size: 563 Bytes

Versions: 13

Compression:

Stored size: 563 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, :translatable => true
  
  def owner
    photographable.owner if photographable && photographable.respond_to?(:owner)
  end

  timestamps

end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
fullstack-cms-0.2.13 app/models/photo.rb
fullstack-cms-0.2.12 app/models/photo.rb
fullstack-cms-0.2.11 app/models/photo.rb
fullstack-cms-0.2.10 app/models/photo.rb
fullstack-cms-0.2.9 app/models/photo.rb
fullstack-cms-0.2.8 app/models/photo.rb
fullstack-cms-0.2.7 app/models/photo.rb
fullstack-cms-0.2.6 app/models/photo.rb
fullstack-cms-0.2.5 app/models/photo.rb
fullstack-cms-0.2.4 app/models/photo.rb
fullstack-cms-0.2.3 app/models/photo.rb
fullstack-cms-0.2.2 app/models/photo.rb
fullstack-cms-0.2.1 app/models/photo.rb