Sha256: 7c56c371cf0fbc257c3b71f7be717d0ab5b0a59e091d50f59005f21f6d79fc88
Contents?: true
Size: 498 Bytes
Versions: 13
Compression:
Stored size: 498 Bytes
Contents
require "active_record" module RailsConnector # # This model is responsible for rating CMS objects. class DefaultRating < ActiveRecord::Base self.abstract_class = true MINIMUM = 1 MAXIMUM = 5 belongs_to :obj validates_uniqueness_of :score, :scope => :obj_id validates_numericality_of :score, :count validates_presence_of :obj_id, :score, :count validates_inclusion_of :score, :in => MINIMUM..MAXIMUM attr_accessible :obj_id, :score, :count end end
Version data entries
13 entries across 13 versions & 1 rubygems