Sha256: e628754cc840daa2cf42804101c9747cc7116d2ed42aa0ece56b27aa6bf55957
Contents?: true
Size: 453 Bytes
Versions: 32
Compression:
Stored size: 453 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 end end
Version data entries
32 entries across 32 versions & 1 rubygems