This class provides atomic $set behaviour.
Sends the atomic $set operation to the database.
@example Persist the new values.
set.persist
@return [ Object ] The new field value.
@ssete 2.0.0
# File lib/mongoid/persistence/atomic/sets.rb, line 17 def persist prepare do value ? document[field] = value : @value = document[field] document[field].tap do collection.update(document.atomic_selector, operation("$set"), options) document.remove_change(field) end end end
Generated with the Darkfish Rdoc Generator 2.