Sha256: 799b153befce7532af0f921f38c0ccffa8bce7a7e56920b4c75359df34e7abf6

Contents?: true

Size: 1.13 KB

Versions: 27

Compression:

Stored size: 1.13 KB

Contents

# frozen_string_literal: true
# encoding: utf-8

class HabtmmCompany
  include Mongoid::Document

  field :c_id, type: Integer
  field :e_ids, type: Array
  has_and_belongs_to_many :employees, class_name: 'HabtmmEmployee',
    primary_key: :e_id, foreign_key: :e_ids,
    inverse_primary_key: :c_id, inverse_foreign_key: :c_ids
end

class HabtmmEmployee
  include Mongoid::Document

  field :e_id, type: Integer
  field :c_ids, type: Array
  field :habtmm_company_ids, type: Array
  has_and_belongs_to_many :companies, class_name: 'HabtmmCompany',
    primary_key: :c_id, foreign_key: :c_ids,
    inverse_primary_key: :e_id, inverse_foreign_key: :e_ids
end

class HabtmmContract
  include Mongoid::Document

  has_and_belongs_to_many :signatures, class_name: 'HabtmmSignature'

  field :item, type: String
end

class HabtmmSignature
  include Mongoid::Document

  has_and_belongs_to_many :contracts, class_name: 'HabtmmContract'

  field :name, type: String
  field :year, type: Integer
end

class HabtmmTicket
  include Mongoid::Document
end

class HabtmmPerson
  include Mongoid::Document

  has_and_belongs_to_many :tickets, class_name: 'HabtmmTicket'
end

Version data entries

27 entries across 27 versions & 2 rubygems

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