-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
(Not at all urgent, just filing for future ideas. Please put in backlog.)
Currently, the atomic operation API allows only one atomic action at a time:
person = Person.all.first # the following lines perform 3 database actions person.set(name: "Bob") person.unset(:first_name) person.inc(likes: 1)
It would be nice if we had a way to lazy evaluate the actions so the run as one command:
person = Person.all.first
person.atomic.set(name: "Bob").unset(:first_name).inc(likes: 1).perform
In the above #atomic is analogous to Enumerable.lazy method.
(Often I find that I do pull and push, set and unset, etc. together in the same places in my code, so this could have some performance advantage.)
- has to be done before
-
MONGOID-4953 Update the updated_at field when updating a HABTM association
- Backlog