module JamRuby
  class RecordingLiker < ActiveRecord::Base

    self.table_name = "recordings_likers"

    self.primary_key = 'id'

    belongs_to :recording, :class_name => "JamRuby::Recording", :foreign_key => "recording_id", :counter_cache => :like_count
    belongs_to :claimed_recording, :class_name => "JamRuby::ClaimedRecording", :foreign_key => "claimed_recording_id"
    belongs_to :user, :class_name => "JamRuby::User", :foreign_key => "liker_id"

    validates :favorite, :inclusion => {:in => [true, false]}
  end
end