Sha256: 2216b0226d639b6e49dbe72e58628d881f6029b4e753a0acebb32b8d05417998

Contents?: true

Size: 312 Bytes

Versions: 17

Compression:

Stored size: 312 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
end

Version data entries

17 entries across 17 versions & 5 rubygems

Version Path
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/mongoid-4.0.2/spec/app/models/book.rb
mongoid-5.0.0 spec/app/models/book.rb
mongoid-5.0.0.rc0 spec/app/models/book.rb
mongoid-5.0.0.beta spec/app/models/book.rb
mongoid-4.0.2 spec/app/models/book.rb
mongoid-4.0.1 spec/app/models/book.rb
mongoid-4.0.0 spec/app/models/book.rb
mongoid-4.0.0.rc2 spec/app/models/book.rb
mongoid-4.0.0.rc1 spec/app/models/book.rb
mongoid-4.0.0.beta2 spec/app/models/book.rb
mongoid-4.0.0.beta1 spec/app/models/book.rb
mongoid-4.0.0.alpha2 spec/app/models/book.rb
mongoid-4.0.0.alpha1 spec/app/models/book.rb
sepastian-mongoid-rails4-4.0.1.alpha spec/app/models/book.rb
sepastian-mongoid-rails4-4.0.0.alpha spec/app/models/book.rb
mongoid_heroku_stable-4.0.0 spec/app/models/book.rb
mongoid_rails4-4.0.0 spec/app/models/book.rb