jhawthorn/discard

after_discard_commit

quorak opened this issue · 1 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.