123456789_123456789_123456789_123456789_123456789_

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

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Extended In:
Defined in: lib/mongoid/association/embedded/embeds_many/proxy.rb

Overview

Class-level methods for the ::Mongoid::Association::Embedded::EmbedsMany::Proxy class.

Instance Attribute Summary

Instance Method Summary

Instance Attribute Details

#embedded?true (readonly)

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

Examples:

Is the association embedded?

Association::Embedded::EmbedsMany.embedded?

Returns:

  • (true)

    true.

[ GitHub ]

  
# File 'lib/mongoid/association/embedded/embeds_many/proxy.rb', line 40

def embedded?
  true
end

Instance Method Details

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

Returns the eager loader for this association.

Parameters:

  • associations (Array<Mongoid::Association>)

    The associations to be eager loaded

  • docs (Array<Mongoid::Document>)

    The parent documents that possess the given associations, which ought to be populated by the eager-loaded documents.

[ GitHub ]

  
# File 'lib/mongoid/association/embedded/embeds_many/proxy.rb', line 29

def eager_loader(associations, docs)
  Eager.new(associations, docs)
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

Returns:

  • (nil)

    nil.

[ GitHub ]

  
# File 'lib/mongoid/association/embedded/embeds_many/proxy.rb', line 50

def foreign_key_suffix
  nil
end