Module: Mongoid::Association::Embedded::EmbedsMany::Proxy::ClassMethods

Included in:
Mongoid::Association::Embedded::EmbedsMany::Proxy
Defined in:
lib/mongoid/association/embedded/embeds_many/proxy.rb

Overview

Class-level methods for the Proxy class.

Instance Method Summary collapse

Instance Method Details

#eager_loader(associations, docs) ⇒ Mongoid::Association::Embedded::Eager

Returns the eager loader for this association.



30
31
32
# File 'lib/mongoid/association/embedded/embeds_many/proxy.rb', line 30

def eager_loader(associations, docs)
  Eager.new(associations, docs)
end

#embedded?true

Returns true if the association is an embedded one. In this case always true.

Examples:

Is the association embedded?

Association::Embedded::EmbedsMany.embedded?


41
42
43
# File 'lib/mongoid/association/embedded/embeds_many/proxy.rb', line 41

def embedded?
  true
end

#foreign_key_suffixnil

Returns the suffix of the foreign key field, either “_id” or “_ids”.

Examples:

Get the suffix for the foreign key.

Association::Embedded::EmbedsMany.foreign_key_suffix


51
52
53
# File 'lib/mongoid/association/embedded/embeds_many/proxy.rb', line 51

def foreign_key_suffix
  nil
end