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

Version Path
infopark_rails_connector-6.8.0.529.114081979 app/models/rails_connector/default_rating.rb
infopark_rails_connector-6.8.0.518.30999728 app/models/rails_connector/default_rating.rb
infopark_rails_connector-6.8.0.515.34928522 app/models/rails_connector/default_rating.rb
infopark_rails_connector-6.8.0.498.46559598 app/models/rails_connector/default_rating.rb
infopark_rails_connector-6.8.0.480.261594408 app/models/rails_connector/default_rating.rb
infopark_rails_connector-6.8.0.444.171626367 app/models/rails_connector/default_rating.rb
infopark_rails_connector-6.8.0.406.131718077 app/models/rails_connector/default_rating.rb
infopark_rails_connector-6.8.0.356.19698103 app/models/rails_connector/default_rating.rb
infopark_rails_connector-6.8.0.348.160665197 app/models/rails_connector/default_rating.rb
infopark_rails_connector-6.8.0.328.4a753fc app/models/rails_connector/default_rating.rb
infopark_rails_connector-6.8.0.322.c003f11 app/models/rails_connector/default_rating.rb
infopark_rails_connector-6.8.0.210.ed204b0 app/models/rails_connector/default_rating.rb
infopark_rails_connector-6.8.0.110.6570b45 app/models/rails_connector/default_rating.rb
infopark_rails_connector-6.8.0.72.d18d096 app/models/rails_connector/default_rating.rb
infopark_rails_connector-6.8.0.23.da7f96b app/models/rails_connector/default_rating.rb
infopark_rails_connector-6.8.0.16.def5e85 app/models/rails_connector/default_rating.rb
infopark_rails_connector-6.8.0.15.a24f5ff app/models/rails_connector/default_rating.rb
infopark_rails_connector-6.8.0.beta.200.891.647580e app/models/rails_connector/default_rating.rb
infopark_rails_connector-6.8.0.beta.200.889.d503e42 app/models/rails_connector/default_rating.rb
infopark_rails_connector-6.8.0.beta.200.883.f5f063b app/models/rails_connector/default_rating.rb