For deleting records in an ActiveRecord collection, we have:
delete_all
(bulk destroy with no callbacks) and it’s companion…
destroy_all
(destroy each with callbacks)
Having two distinct methods for this is valuable because you have two clear options for deleting records from a collection.
However, this isn’t true for collection updates. We only have:
update_all
(bulk update without callback)
update_all
is missing it’s companion (maybe update_each
) that updates each with callbacks.
Adding an update_each
method would be a great natural companion for update_all
, and give developers two clear options when updating a collection. It’s a small change, but I think it provides a better developer experience.
Thanks for considering this proposal!