You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 13, 2025. It is now read-only.
The main use case for the gem is to get all the committed changes in the after_commit callback, however, changes to the record in the after_commit callbacks affect transaction_changed_attributes.
For instance, unsaved changes will be added to transaction_changed_attributes. If the record were saved in the after_commit callback, then transaction_changed_attributes would be cleared. If the changes happen in one after_commit callback then they will affect the following after_commit callbacks.
I actually noticed this problem while looking into a similar issue in active record with saved_changes where it isn't safe to assume that saved_changes in an after_save callback is giving the changes for the save that caused the callback to be called, since the record could have been saved in a preceding after save callback.
I would recommend avoiding changing the record in after commit callbacks as a workaround if anyone encounters this issue.
The main use case for the gem is to get all the committed changes in the after_commit callback, however, changes to the record in the after_commit callbacks affect
transaction_changed_attributes.For instance, unsaved changes will be added to
transaction_changed_attributes. If the record were saved in the after_commit callback, thentransaction_changed_attributeswould be cleared. If the changes happen in one after_commit callback then they will affect the following after_commit callbacks.I actually noticed this problem while looking into a similar issue in active record with
saved_changeswhere it isn't safe to assume thatsaved_changesin anafter_savecallback is giving the changes for thesavethat caused the callback to be called, since the record could have been saved in a preceding after save callback.I would recommend avoiding changing the record in after commit callbacks as a workaround if anyone encounters this issue.