Sha256: c6ecc2e8633fff05ad0d0a833722670c484318c22761d9123288a0e4fee68650

Contents?: true

Size: 756 Bytes

Versions: 13

Compression:

Stored size: 756 Bytes

Contents

# frozen_string_literal: true
# encoding: utf-8

class HmmCompany
  include Mongoid::Document

  field :p, type: Integer
  has_many :emails, primary_key: :p, foreign_key: :f, class_name: 'HmmEmail'
end

class HmmEmail
  include Mongoid::Document

  field :f, type: Integer
  belongs_to :company, primary_key: :p, foreign_key: :f, class_name: 'HmmCompany'
end

class HmmSchool
  include Mongoid::Document

  has_many :students, class_name: 'HmmStudent'

  field :district, type: String
  field :team, type: String
end

class HmmStudent
  include Mongoid::Document

  belongs_to :school, class_name: 'HmmSchool'

  field :name, type: String
  field :grade, type: Integer, default: 3
end

class HmmTicket
  include Mongoid::Document

  belongs_to :person
end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
mongoid-7.1.11 spec/mongoid/association/referenced/has_many_models.rb
mongoid-7.1.10 spec/mongoid/association/referenced/has_many_models.rb
mongoid-7.1.9 spec/mongoid/association/referenced/has_many_models.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/mongoid-7.1.7/spec/mongoid/association/referenced/has_many_models.rb
mongoid-7.1.8 spec/mongoid/association/referenced/has_many_models.rb
mongoid-7.1.7 spec/mongoid/association/referenced/has_many_models.rb
mongoid-7.1.6 spec/mongoid/association/referenced/has_many_models.rb
mongoid-7.1.5 spec/mongoid/association/referenced/has_many_models.rb
mongoid-7.1.4 spec/mongoid/association/referenced/has_many_models.rb
mongoid-7.1.2 spec/mongoid/association/referenced/has_many_models.rb
mongoid-7.1.1 spec/mongoid/association/referenced/has_many_models.rb
mongoid-7.1.0 spec/mongoid/association/referenced/has_many_models.rb
mongoid-7.1.0.rc0 spec/mongoid/association/referenced/has_many_models.rb