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

10 lines
248 B
Ruby
Raw Normal View History

class Rate < ActiveRecord::Base
has_many :ratings
validates_presence_of :score
validates_uniqueness_of :score
validates_numericality_of :score, :greater_than_or_equal_to => 1, :less_than_or_equal_to => 10
attr_accessor :user_id
end