diff options
author | Myron Marston <myron.marston@gmail.com> | 2011-08-12 19:58:37 -0700 |
---|---|---|
committer | Myron Marston <myron.marston@gmail.com> | 2011-08-12 20:48:44 -0700 |
commit | d3c15a1d31d77e44b142c96cb55b654f3552a89d (patch) | |
tree | 6da096998bbd1c3a0764a10a3c933f943b6e973a /activerecord/lib/active_record | |
parent | 943a37348a9fdef73670be3d8452d436b7db0e69 (diff) | |
download | rails-d3c15a1d31d77e44b142c96cb55b654f3552a89d.tar.gz rails-d3c15a1d31d77e44b142c96cb55b654f3552a89d.tar.bz2 rails-d3c15a1d31d77e44b142c96cb55b654f3552a89d.zip |
Allow ActiveRecord observers to be disabled.
We have to use Observer#update rather than Observer#send since the enabled state is checked in #update before forwarding the method call on.
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/observer.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/observer.rb b/activerecord/lib/active_record/observer.rb index 5a5351b517..fdf17c003c 100644 --- a/activerecord/lib/active_record/observer.rb +++ b/activerecord/lib/active_record/observer.rb @@ -111,7 +111,7 @@ module ActiveRecord callback_meth = :"_notify_#{observer_name}_for_#{callback}" unless klass.respond_to?(callback_meth) klass.send(:define_method, callback_meth) do |&block| - observer.send(callback, self, &block) + observer.update(callback, self, &block) end klass.send(callback, callback_meth) end |