In my rails app the child records get marked_for_destruction I want to undo that action and unmark them. Is there a way?
Thanks in advance.
In my rails app the child records get marked_for_destruction I want to undo that action and unmark them. Is there a way?
Thanks in advance.
child.reload if child.marked_for_destruction?
From ActiveRecord::AutosaveAssociation:
reload
(options = nil)
Reloads the attributes of the object as usual and clears marked_for_destruction flag.
© 2022 - 2024 — McMap. All rights reserved.