Sha256: 613b4283900e831dae815b23a4e40d1327067980327a3c124f633ed98b2730ac

Contents?: true

Size: 244 Bytes

Versions: 91

Compression:

Stored size: 244 Bytes

Contents

class Rating
  include Mongoid::Document
  field :value, type: Integer
  belongs_to :ratable, polymorphic: true
  has_many :comments
  validates_numericality_of :value, less_than: 100, allow_nil: true
  validates :ratable, associated: true
end

Version data entries

91 entries across 86 versions & 8 rubygems

Version Path
mongoid-7.0.13 spec/app/models/rating.rb
mongoid-7.0.12 spec/app/models/rating.rb
mongoid-6.4.8 spec/app/models/rating.rb
mongoid-7.0.11 spec/app/models/rating.rb
mongoid-7.0.10 spec/app/models/rating.rb
mongoid-6.4.7 spec/app/models/rating.rb
mongoid-6.4.5 spec/app/models/rating.rb
mongoid-7.0.8 spec/app/models/rating.rb
mongoid-7.0.7 spec/app/models/rating.rb
mongoid-7.0.6 spec/app/models/rating.rb
mongoid-5.4.1 spec/app/models/rating.rb
mongoid-7.0.5 spec/app/models/rating.rb
mongoid-7.0.4 spec/app/models/rating.rb
mongoid-6.4.4 spec/app/models/rating.rb
mongoid-7.0.3 spec/app/models/rating.rb
mongoid-6.4.2 spec/app/models/rating.rb
mongoid-7.0.2 spec/app/models/rating.rb
mongoid-7.0.1 spec/app/models/rating.rb
mongoid-6.4.1 spec/app/models/rating.rb
mongoid-5.4.0 spec/app/models/rating.rb