module Mongoid::Association::Embedded::EmbedsMany::Proxy::ClassMethods

Class-level methods for the Proxy class.

Public Instance Methods

eager_loader(associations, docs) click to toggle source

Returns the eager loader for this association.

@param [ Array<Mongoid::Association> ] associations The

associations to be eager loaded

@param [ Array<Mongoid::Document> ] docs The parent documents

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

@return [ Mongoid::Association::Embedded::Eager ]

# File lib/mongoid/association/embedded/embeds_many/proxy.rb, line 29
def eager_loader(associations, docs)
  Eager.new(associations, docs)
end
embedded?() click to toggle source

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

@example Is the association embedded?

Association::Embedded::EmbedsMany.embedded?

@return [ true ] true.

# File lib/mongoid/association/embedded/embeds_many/proxy.rb, line 40
def embedded?
  true
end
foreign_key_suffix() click to toggle source

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

@example Get the suffix for the foreign key.

Association::Embedded::EmbedsMany.foreign_key_suffix

@return [ nil ] nil.

# File lib/mongoid/association/embedded/embeds_many/proxy.rb, line 50
def foreign_key_suffix
  nil
end