Class: Mongoid::Atomic::Paths::Embedded::Many
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Instance Chain:
|
|
Inherits: | Object |
Defined in: | lib/mongoid/atomic/paths/embedded/many.rb |
Overview
This class encapsulates behavior for locating and updating documents that are defined as an embedded 1-n.
Class Method Summary
-
.new(document) ⇒ Many
constructor
Create the new path utility.
-
.position_without_document(parent, association) ⇒ String
Get the position of where the document would go for the given association.
Instance Attribute Summary
::Mongoid::Atomic::Paths::Embedded
- Included
Instance Method Summary
-
#position ⇒ String
Get the position of the document in the hierarchy.
::Mongoid::Atomic::Paths::Embedded
- Included
#path | Get the path to the document in the hierarchy. |
Constructor Details
.new(document) ⇒ Many
Create the new path utility.
Class Method Details
.position_without_document(parent, association) ⇒ String
Get the position of where the document would go for the given association. The use case for this function is when trying to persist an empty list for an embedded association. All of the existing functions for getting the position to store a document require passing in a document to store, which we don’t have when trying to store the empty list.
Instance Method Details
#position ⇒ String
Get the position of the document in the hierarchy. This will include indexes of 1-n embedded associations that may sit above the embedded many.