ensl.org/vendor/plugins/acts_as_rateable/lib/rating.rb

6 lines
182 B
Ruby

class Rating < ActiveRecord::Base
belongs_to :rate
belongs_to :rateable, :polymorphic => true
validates_uniqueness_of :user_id, :scope => [:rateable_id, :rateable_type]
end