-
Notifications
You must be signed in to change notification settings - Fork 529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
after_destroy_commit callback is not triggered on soft delete #450
Comments
We have had to avoid the use of |
For what it's worth there's a pull request that purports to resolve this that's been open a while now: |
This is still not working for me. Any advice on how you triggered the callbacks in Rails 6? Tried with the following:
Neither |
I'm also still experiencing the same thing for |
I'd like to know what is causing it, I haven't been able to track it down... |
@mathieujobin False alarm. Realized the code was calling |
According to the documentation (and also tested behaviour) acts_as_paranoid classes trigger the after_destroy callbacks whenever an object is soft-deleted and after_real_destroy when the object is really removed from the database. However there is another AR callback called "after_destroy_commit" which are not triggered on soft-delete. This caused a bug in our implementation, as I would expect it to be desired behaviour that after_destroy_commit callbacks are actually triggered on soft delete. The callback could be fired once the deleted_at-update commit has been committed to the database.
The text was updated successfully, but these errors were encountered: