Sha256: 98654eede1ea3b61970d03d9e48f14aec7305ec01017d6bf977e2c17b4cc2712

Contents?: true

Size: 334 Bytes

Versions: 29

Compression:

Stored size: 334 Bytes

Contents

class Book
  include Mongoid::Document
  include Mongoid::Attributes::Dynamic
  field :title, type: String
  field :chapters, type: Integer
  belongs_to :series
  belongs_to :person, autobuild: true
  has_one :rating, as: :ratable, dependent: :nullify

  after_initialize do |doc|
    doc.chapters = 5
  end

  embeds_many :pages
end

Version data entries

29 entries across 26 versions & 3 rubygems

Version Path
mongoid-5.4.1 spec/app/models/book.rb
mongoid-5.4.0 spec/app/models/book.rb
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/mongoid-6.1.0/spec/app/models/book.rb
tdiary-5.0.5 vendor/bundle/gems/mongoid-6.1.0/spec/app/models/book.rb
mongoid-5.2.1 spec/app/models/book.rb
tdiary-5.0.4 vendor/bundle/gems/mongoid-6.1.0/spec/app/models/book.rb
mongoid-6.1.0 spec/app/models/book.rb
mongoid-5.2.0 spec/app/models/book.rb
mongoid-5.2.0.rc0 spec/app/models/book.rb
mongoid-6.1.0.rc0 spec/app/models/book.rb
mongoid-6.0.3 spec/app/models/book.rb
mongoid-5.1.6 spec/app/models/book.rb
mongoid-6.0.2 spec/app/models/book.rb
mongoid-6.0.1 spec/app/models/book.rb
mongoid-5.1.5 spec/app/models/book.rb
mongoid-6.0.0 spec/app/models/book.rb
mongoid-5.1.4 spec/app/models/book.rb
mongoid-6.0.0.rc0 spec/app/models/book.rb
mongoid-6.0.0.beta spec/app/models/book.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/mongoid-5.1.3/spec/app/models/book.rb