123456789_123456789_123456789_123456789_123456789_

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

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: Mongoid::Association::EagerLoad::AssociationInclusion
Defined in: lib/mongoid/association/eager_load/inclusion.rb

Overview

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.

Class Method Summary

AssociationInclusion - Inherited

.for

Builds the right kind of inclusion for the association.

.for?

Whether this kind handles the given association.

.new

Instance Attribute Summary

Instance Method Summary

Inclusion - Inherited

#contribute

Add this inclusion's stages to the destination.

Constructor Details

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

Class Method Details

.for?(association) ⇒ true | false

Parameters:

Returns:

  • (true | false)

    Whether the association is polymorphic.

[ GitHub ]

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

def for?(association)
  association.polymorphic?
end

Instance Method Details

#contribute(destination, chain)

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

Parameters:

[ GitHub ]

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

def contribute(destination, chain); end