Class: Mongoid::Association::EagerLoad::DeferredInclusion Private

Inherits:
AssociationInclusion show all
Defined in:
lib/mongoid/association/eager_load/inclusion.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

A polymorphic inclusion: its target collection varies per document, so it can't be a $lookup. It adds nothing here; PolymorphicPreloader resolves it after the roots are materialized.

Instance Attribute Summary

Attributes inherited from AssociationInclusion

#association

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from AssociationInclusion

for, #initialize

Constructor Details

This class inherits a constructor from Mongoid::Association::EagerLoad::AssociationInclusion

Class Method Details

.for?(association) ⇒ true | false

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns Whether the association is polymorphic.



159
160
161
# File 'lib/mongoid/association/eager_load/inclusion.rb', line 159

def for?(association)
  association.polymorphic?
end

Instance Method Details

#contribute(destination, chain) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Add nothing; PolymorphicPreloader resolves the association after the roots are materialized.



169
# File 'lib/mongoid/association/eager_load/inclusion.rb', line 169

def contribute(destination, chain); end