Sha256: e626c1d28b47eea0d181fab6b4c3e51e73fe9c60ac289ab3cb0188b94d0cd061

Contents?: true

Size: 326 Bytes

Versions: 10

Compression:

Stored size: 326 Bytes

Contents

class Product
  include Mongoid::Document

  field :name
  field :reference
  field :quantity, type: Integer

  belongs_to :category

  embeds_many :comments, as: :commentable
  embeds_one :manager, as: :managable

  validates_presence_of :name
  validates_associated :category

  accepts_nested_attributes_for :category
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
iord-1.2.2 test/dummy/app/models/product.rb
iord-1.2.1 test/dummy/app/models/product.rb
iord-1.2.0 test/dummy/app/models/product.rb
iord-1.1.3 test/dummy/app/models/product.rb
iord-1.1.2 test/dummy/app/models/product.rb
iord-1.1.1 test/dummy/app/models/product.rb
iord-1.1.0 test/dummy/app/models/product.rb
iord-1.0.3 test/dummy/app/models/product.rb
iord-1.0.2 test/dummy/app/models/product.rb
iord-1.0.1 test/dummy/app/models/product.rb