[Feature Request] 'On' option for after_save callbacks

已查看 19 次
跳至第一个未读帖子

Anuj N

未读,
2016年9月4日 18:46:062016/9/4
收件人 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

未读,
2016年9月5日 17:31:302016/9/5
收件人 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.
回复全部
回复作者
转发
0 个新帖子