This class provides the ability to perform an explicit $pushAll modification on a specific field.
Sends the atomic $pushAll operation to the database.
@example Persist the new values.
pushAll.persist
@return [ Object ] The new array value.
@since 2.1.0
# File lib/mongoid/persistence/atomic/push_all.rb, line 18 def persist prepare do document[field] = [] unless document[field] document.send(field).concat(value).tap do |value| collection.update(document.atomic_selector, operation("$pushAll"), options) document.remove_change(field) end end end
Generated with the Darkfish Rdoc Generator 2.