Sha256: bde16b1a60998a3e10f3757d854e1027521b6fe44df591de03aa15ecc0f0e217

Contents?: true

Size: 1021 Bytes

Versions: 27

Compression:

Stored size: 1021 Bytes

Contents

# frozen_string_literal: true
# encoding: utf-8

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 :decimal, type: BSON::Decimal128
  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_many :labels
  embeds_one :label, cascade_callbacks: true

  has_many :same_name, class_name: 'Agent', inverse_of: :same_name

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

Version data entries

27 entries across 27 versions & 2 rubygems

Version Path
mongoid-7.3.5 spec/support/models/band.rb
mongoid-7.3.4 spec/support/models/band.rb
mongoid-7.1.11 spec/app/models/band.rb
mongoid-7.2.6 spec/support/models/band.rb
mongoid-7.3.3 spec/support/models/band.rb
mongoid-7.3.2 spec/support/models/band.rb
mongoid-7.2.5 spec/support/models/band.rb
mongoid-7.1.10 spec/app/models/band.rb
mongoid-7.1.9 spec/app/models/band.rb
mongoid-7.2.4 spec/support/models/band.rb
mongoid-7.3.1 spec/support/models/band.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/mongoid-7.1.7/spec/app/models/band.rb
mongoid-7.3.0 spec/support/models/band.rb
mongoid-7.2.3 spec/support/models/band.rb
mongoid-7.1.8 spec/app/models/band.rb
mongoid-7.2.2 spec/support/models/band.rb
mongoid-7.2.1 spec/support/models/band.rb
mongoid-7.1.7 spec/app/models/band.rb
mongoid-7.2.0 spec/support/models/band.rb
mongoid-7.1.6 spec/app/models/band.rb