We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 51add67 commit aa148bdCopy full SHA for aa148bd
lib/mongoid/touchable.rb
@@ -27,10 +27,7 @@ def touch(field = nil)
27
return false if _root.new_record?
28
29
touches = __gather_touch_updates(Time.now, field)
30
- unless touches.blank?
31
- selector = _root.atomic_selector
32
- _root.collection.find(selector).update_one(positionally(selector, '$set' => touches), session: _session)
33
- end
+ _root.send(:persist_atomic_operations, '$set' => touches) if touches.present?
34
35
__run_touch_callbacks_from_root
36
true
0 commit comments