Sha256: 1eae3a3cdeeb96ad5a2d8600a9c2bed83c838c4c2187851478a0600793adda5b

Contents?: true

Size: 752 Bytes

Versions: 18

Compression:

Stored size: 752 Bytes

Contents

class Band
  include Mongoid::Document
  field :name, type: String
  field :active, type: 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: Boolean, default: false
  field :created, type: DateTime
  field :sales, type: BigDecimal
  field :y, as: :years, type: Integer
  field :founded, type: Date

  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

18 entries across 18 versions & 3 rubygems

Version Path
mongoid-paranoia-1.1.0 spec/app/models/band.rb
mongoid-paranoia-1.0.1 spec/app/models/band.rb
mongoid-3.1.7 spec/app/models/band.rb
mongoid-paranoia-1.0.0 spec/app/models/band.rb
mongoid-versioning-1.0.0 spec/app/models/band.rb
mongoid-paranoia-1.0.0.beta2 spec/app/models/band.rb
mongoid-versioning-1.0.0.beta2 spec/app/models/band.rb
mongoid-paranoia-1.0.0.beta1 spec/app/models/band.rb
mongoid-versioning-1.0.0.beta1 spec/app/models/band.rb
mongoid-3.1.6 spec/app/models/band.rb
mongoid-3.1.5 spec/app/models/band.rb
mongoid-paranoia-0.3.0 spec/app/models/band.rb
mongoid-paranoia-0.2.1 spec/app/models/band.rb
mongoid-versioning-0.2.0 spec/app/models/band.rb
mongoid-paranoia-0.2.0 spec/app/models/band.rb
mongoid-paranoia-0.1.1 spec/app/models/band.rb
mongoid-versioning-0.1.0 spec/app/models/band.rb
mongoid-paranoia-0.1.0 spec/app/models/band.rb