[Feature Request] 'On' option for after_save callbacks

19 views
Skip to first unread message

Anuj N

unread,
Sep 4, 2016, 6:46:06 PM9/4/16
to Ruby on Rails: Core
Hi folks!

As per https://github.com/rails/rails/issues/22515, 5.0 saw after_create_commit, after_update_commit, after_destroy_commit being added as aliases to after_commit, on:create, etc. From https://github.com/rails/rails/issues/12502, it seems that `on` flag only works for after_commit but not after_save

I was wondering if it would be possible to allow `on` flag for after_save as well and see similar aliases if that option is implemented? Often times, I have been wanting to trigger those callbacks only on updates and not say create, and haven't found a clean solution. It also feels consistent in style with the validation callbacks and now after_commit callbacks.

Thank you,
Anuj

Rafael Mendonça França

unread,
Sep 5, 2016, 5:31:30 PM9/5/16
to Ruby on Rails: Core
Is not that what after_update does?
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-co...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
Visit this group at https://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages