DEV Community

Discussion on: Well that was embarrassing.

 
gokuldroid profile image
Gokuldroid • Edited

I think you should use after_create_commit, as after_commit will get called for every update operation. If you end up updating the signup record in any situation, you might send a duplicate notification if you don't have any conditions to check whether is it a new record or not while sending notification. or use like this after_commit :do_foo_bar, on: [:create]

Thread Thread
 
swanny85 profile image
Steve

Thanks. Yeah after_commit was a mistake, hence the title of my article. I swapped to after_commit_create after Ben pointed it out.