Module: Mongoid::Includes::Relations::Eager

Defined in:
lib/mongoid/includes/relations/eager.rb

Overview

Internal: Patch to the base class for eager load preload functions, that interacts with the Mongoid::Includes::Inclusion as @medatada.

Instance Method Summary collapse

Instance Method Details

#each_loaded_documentObject

Internal: Performs eager load and iterates over the preloaded documents for the current relation.



11
12
13
14
15
# File 'lib/mongoid/includes/relations/eager.rb', line 11

def each_loaded_document
  @metadata.load_documents_for(key, keys_from_docs).each do |doc|
    yield doc
  end
end