Back to Parent

class Picture < ActiveRecord::Base
  attr_accessible :user_id, :status
  attr_protected  :path # we don't want hackers change this and point it to nowhere, right?


  # Use Carrierwave for Upload?

  # mount_uploader :path, PictureUploader


  validates :status, :in => %w( shared public private )
  scope     :public, where( :status => "public" )

  # Favorite Association

  has_many :favorite_pictures, :class_name => "FavoritePicture"
  has_many :fav_users, :through => :favorite_pictures, :class_name => "User", :foreign_key => "user_id"
end
Click to Expand

Content Rating

Is this a good/useful/informative piece of content to include in the project? Have your say!

0