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 has been archived by the owner on Jul 13, 2023. It is now read-only.
I noticed that attachments are being removed in an after_destroy callback, which runs within the database transaction, but doesn't seem to need to. ActiveRecord 3.0 added after_commit as a callback, which runs after the transaction completes successfully, and seems to be more appropriate for this situation.
As of now, I'm patching around with the following to do this:
Hello,
I noticed that attachments are being removed in an
after_destroy
callback, which runs within the database transaction, but doesn't seem to need to. ActiveRecord 3.0 addedafter_commit
as a callback, which runs after the transaction completes successfully, and seems to be more appropriate for this situation.As of now, I'm patching around with the following to do this:
which is working fine. Is there a reason it shouldn't be done this way, that I'm not aware of?
The text was updated successfully, but these errors were encountered: