Sha256: 2dd449d17379de775872325c1348be8462f39a4b43fb6a1c98b0d4d43b9d1001

Contents?: true

Size: 841 Bytes

Versions: 22

Compression:

Stored size: 841 Bytes

Contents

class Band
  include Mongoid::Document
  include Mongoid::Attributes::Dynamic
  field :name, type: String
  field :active, type: Mongoid::Boolean, default: true
  field :origin, type: String
  field :genres, type: Array
  field :member_count, type: Integer
  field :mems, as: :members, type: Array
  field :likes, type: Integer
  field :views, type: Integer
  field :rating, type: Float
  field :upserted, type: Mongoid::Boolean, default: false
  field :created, type: DateTime
  field :sales, type: BigDecimal
  field :y, as: :years, type: Integer
  field :founded, type: Date
  field :deleted, type: Boolean

  embeds_many :records, cascade_callbacks: true
  embeds_many :notes, as: :noteable, cascade_callbacks: true, validate: false
  embeds_one :label, cascade_callbacks: true

  after_upsert do |doc|
    doc.upserted = true
  end
end

Version data entries

22 entries across 20 versions & 3 rubygems

Version Path
mongoid-6.0.3 spec/app/models/band.rb
mongoid-5.1.6 spec/app/models/band.rb
mongoid-6.0.2 spec/app/models/band.rb
mongoid-6.0.1 spec/app/models/band.rb
mongoid-5.1.5 spec/app/models/band.rb
mongoid-6.0.0 spec/app/models/band.rb
mongoid-5.1.4 spec/app/models/band.rb
mongoid-6.0.0.rc0 spec/app/models/band.rb
mongoid-6.0.0.beta spec/app/models/band.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/mongoid-5.1.3/spec/app/models/band.rb
mongoid-5.1.3 spec/app/models/band.rb
mongoid-5.1.2 spec/app/models/band.rb
mongoid-5.1.1 spec/app/models/band.rb
mongoid-5.1.0 spec/app/models/band.rb
tdiary-4.2.1 vendor/bundle/ruby/2.2.0/gems/mongoid-5.0.2/spec/app/models/band.rb
tdiary-4.2.1 vendor/bundle/ruby/2.3.0/gems/mongoid-5.0.2/spec/app/models/band.rb
tdiary-4.2.1 vendor/bundle/ruby/2.2.0/gems/mongoid-5.0.1/spec/app/models/band.rb
mongoid-5.0.2 spec/app/models/band.rb
mongoid-5.0.1 spec/app/models/band.rb
mongoid-5.0.0 spec/app/models/band.rb