This blog is part of our Rails 5 series.
Rails 4.x has
after_commit is called after a
record has been created,
updated or destroyed.
Rails 5 added new aliases
Rails 5 had added following three aliases.
Here is revised code after using these aliases.
We earlier stated that
after_commit callback is executed at the end
of transaction. Using
after_commit with a transaction block can be
tricky. Please checkout our earlier post about
Gotcha with after_commit callback in Rails