-
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
Destroy does not trigger after_commit :destroy #337
Comments
This is still happening, and with Rails 5.1 the approach of checking for the |
This actually works (solution from vital) |
I'm currently in the process of upgrading a Rails 4.2 project to 5.1, and in 4.2 the |
guys any updates on this issue? for us it's a very important one |
@jhawthorn what is the desired behaviour here? |
hmm.... it seems that this issue is still happening Rails 6.0.0.beta3 |
still happening. Works on create and update but not on destroy. this has been happening for while it seems... any chance of a workaround? |
If anyone needs a workaround |
@rapito but |
Rails 6.0.2, As this was first reported in 2016, should I assume its now a feature? |
CONTEXT
When adding acts_as_paranoid to existing classes that utilise after_commit blocks, paranoia unexpectedly does not handle destruction of records properly.
STEPS TO REPRODUCE
With a class Foo, that acts_as paranoid,
The following snippet is not called:
When this snippet is run:
f = Foo.new
f.destroy!
EXPECTATION
I expected the after_commit callback to be called.
ACTUAL OUTCOME
The after_commit callback was never called.
MORE INFO
Relates to #296
One work around is to check after_commit on: :update, if the deleted_at column is set or not, but it's not an ideal soluton.
Is the current behaviour the desired behaviour?
If not, I'd be happy to contribute a fix.
The text was updated successfully, but these errors were encountered: