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
Problem: To log changes in any model I am using after_commit callback if active record, but when I change state using event then I am not able to use after_commit callback. Is there any way to handle this ?
Basically I want to log any change in model, as after_commit only runs after transaction block is successfully executed therefore I am using after_commit callback
Any help ?
The text was updated successfully, but these errors were encountered:
It's a bit of a hack, but it ensures that the callbacks get triggered on every state transition. Been using it for quite a while now and haven't had any issues with it. Make sure that :status is the name of your state attribute.
Hi
Problem: To log changes in any model I am using after_commit callback if active record, but when I change state using event then I am not able to use after_commit callback. Is there any way to handle this ?
Basically I want to log any change in model, as after_commit only runs after transaction block is successfully executed therefore I am using after_commit callback
Any help ?
The text was updated successfully, but these errors were encountered: