Module: Mongoid::Locking::Persistable
- Defined in:
- lib/mongoid/locking/persistable.rb,
lib/mongoid/locking/persistable/creatable.rb,
lib/mongoid/locking/persistable/updatable.rb
Overview
:nodoc:
Defined Under Namespace
Instance Method Summary collapse
-
#persist_atomic_operations(operations) ⇒ Object
Overrides the default Mongoid::Persistable#persist_atomic_operations to: - include the lock_version in the atomic selector - increment the lock_version in the atomic updates.
Methods included from Updatable
Methods included from Creatable
Instance Method Details
#persist_atomic_operations(operations) ⇒ Object
Overrides the default Mongoid::Persistable#persist_atomic_operations to:
-
include the lock_version in the atomic selector
-
increment the lock_version in the atomic updates
11 12 13 14 15 16 |
# File 'lib/mongoid/locking/persistable.rb', line 11 def persist_atomic_operations(operations) return unless persisted? && operations.present? selector = atomic_selector _update_one_locked(_root.collection, selector, operations) end |