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.beta.200.884.4bd86e6 app/models/rails_connector/default_rating.rb
infopark_rails_connector-6.8.0.beta.200.869.9609b39 app/models/rails_connector/default_rating.rb
infopark_rails_connector-6.8.0.beta.200.856.8c0fec5 app/models/rails_connector/default_rating.rb
infopark_rails_connector-6.8.0.beta.200.809.bdfa8c3 app/models/rails_connector/default_rating.rb
infopark_rails_connector-6.8.0.beta.200.785.05d4af9 app/models/rails_connector/default_rating.rb
infopark_rails_connector-6.8.0.beta.200.744.99f67fc app/models/rails_connector/default_rating.rb
infopark_rails_connector-6.8.0.beta.200.720.44fbabd app/models/rails_connector/default_rating.rb
infopark_rails_connector-6.8.0.beta.200.713.e5c3150 app/models/rails_connector/default_rating.rb
infopark_rails_connector-6.8.0.beta.200.681.7c84f4a app/models/rails_connector/default_rating.rb
infopark_rails_connector-6.8.0.beta.200.663.ceecdee app/models/rails_connector/default_rating.rb
infopark_rails_connector-6.8.0.beta.200.650.7c93155 app/models/rails_connector/default_rating.rb
infopark_rails_connector-6.8.0.beta.200.621.4c8e1b0 app/models/rails_connector/default_rating.rb