Skip to content
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_discard_commit #73

Open
quorak opened this issue Mar 5, 2020 · 1 comment
Open

after_discard_commit #73

quorak opened this issue Mar 5, 2020 · 1 comment

Comments

@quorak
Copy link

quorak commented Mar 5, 2020

Do you think a after_discard_commit makes sense, which is triggered just as after_destroy_commit ?
Reason is, that we have some queue triggers that should only be fired when the transactin was comitted not on rollbacks.

thx

@joaodiogocosta
Copy link

joaodiogocosta commented Jun 27, 2021

@quorak I also had this question, but then I went in and saw that after_discard and after_undiscard are ActiveModel callbacks around calls to update_attribute:

run_callbacks(:discard) do
update_attribute(self.class.discard_column, Time.current)
end

So they will be effectively triggered after the transaction is committed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants