jhawthorn / discard

🃏🗑 Soft deletes for ActiveRecord done right

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

after_discard_commit

quorak opened this issue · comments

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

@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.