You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
classPostdefine_model_callbacks:approve,:only=>:afterdefapprove!run_callbacks(:approve)doupdate_attribute(:approved,true)endendendclassPostObserverdefafter_approve(post)# do somethingendend
This won't work as expected, because ActiveRecord::Observer defines the notify methods using the following code:
I moved the notifying call into an own method, so that you just have to use define_model_callbacks_for_observersinstead of ``define_model_callbacks` (you might want to put this into a module):
Hey, I'm closing this as stale, if anyone wants to try out a pull request, please go ahead. You can gather more feedback first if you want in the Rails Core mailing list. Thanks.
Consider the following:
This won't work as expected, because ActiveRecord::Observer defines the notify methods using the following code:
Therefore only ActiveRecord::Callbacks::CALLBACKS are going to be used.
The text was updated successfully, but these errors were encountered: