Common functionality between the two different embedded paths.
Get the path to the document in the hierarchy.
@example Get the path.
many.path
@return [ String ] The path to the document.
@since 2.1.0
# File lib/mongoid/atomic/paths/embedded.rb, line 21 def path position.sub(/\.\d+$/, "") end
Get the selector to use for the root document when performing atomic updates. When sharding this will include the shard key.
@example Get the selector.
many.selector
@return [ Hash ] The selector to identify the document with.
@since 2.1.0
# File lib/mongoid/atomic/paths/embedded.rb, line 34 def selector parent.atomic_selector. merge!({ "#{path}._id" => document.identifier || document._id }). merge!(document.shard_key_selector) end
Generated with the Darkfish Rdoc Generator 2.