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

Version Path
infopark_rails_connector-6.9.1.3.22208381 app/models/rails_connector/default_rating.rb
infopark_rails_connector-6.9.0.3.197272233 app/models/rails_connector/default_rating.rb
infopark_rails_connector-6.8.3.174.51542603 app/models/rails_connector/default_rating.rb
infopark_rails_connector-6.8.3.115.227021242 app/models/rails_connector/default_rating.rb
infopark_rails_connector-6.8.3.73.75172665 app/models/rails_connector/default_rating.rb
infopark_rails_connector-6.8.3.2.153416031 app/models/rails_connector/default_rating.rb
infopark_rails_connector-6.8.3.67.110847540 app/models/rails_connector/default_rating.rb
infopark_rails_connector-6.8.3.1.23895778 app/models/rails_connector/default_rating.rb
infopark_rails_connector-6.8.2.36.82613853 app/models/rails_connector/default_rating.rb
infopark_rails_connector-6.8.2.7.128454143 app/models/rails_connector/default_rating.rb
infopark_rails_connector-6.8.1.26.236500544 app/models/rails_connector/default_rating.rb
infopark_rails_connector-6.8.1 app/models/rails_connector/default_rating.rb
infopark_rails_connector-6.8.0.539.93842523 app/models/rails_connector/default_rating.rb