Class: Mongoid::Association::EagerLoad::EmbeddedInclusion Private
- Inherits:
-
AssociationInclusion
- Object
- Inclusion
- AssociationInclusion
- Mongoid::Association::EagerLoad::EmbeddedInclusion
- 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.
An embedded inclusion: it rides inside its own document, so it adds no stage of its own. Its children contribute to the same destination, with this document appended to their embedded path.
For Computer.eager_load(port: :device) the :port inclusion emits nothing; it hands the path [ :port ] to :device, which EmbeddedDistributor then turns into stages.
Instance Attribute Summary
Attributes inherited from AssociationInclusion
Class Method Summary collapse
-
.for?(association) ⇒ true | false
private
Whether the association is embedded.
Instance Method Summary collapse
-
#contribute(destination, chain) ⇒ Object
private
Add no stage of its own; hand this document down the embedded path so the children distribute onto it.
Methods inherited from AssociationInclusion
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 embedded.
132 133 134 |
# File 'lib/mongoid/association/eager_load/inclusion.rb', line 132 def for?(association) association. 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 no stage of its own; hand this document down the embedded path so the children distribute onto it.
144 145 146 |
# File 'lib/mongoid/association/eager_load/inclusion.rb', line 144 def contribute(destination, chain) @children.each { |child| child.contribute(destination, chain + [ @association ]) } end |