module Mongoid::Includes::Association::Eager

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

Public Instance Methods

each_loaded_document() { |doc| ... } click to toggle source

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

# File lib/mongoid/includes/association/eager.rb, line 11
def each_loaded_document
  @association.load_documents_for(key, keys_from_docs).each do |doc|
    yield doc
  end
end