From 17fa4ef6667e025e3f263cd008538740a5d003ad Mon Sep 17 00:00:00 2001 From: Angelo Capilleri Date: Tue, 3 Jul 2012 09:08:33 +0200 Subject: [PATCH] observer update refactoring --- activemodel/lib/active_model/observing.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/activemodel/lib/active_model/observing.rb b/activemodel/lib/active_model/observing.rb index f5ea285ccb..ca206ee9aa 100644 --- a/activemodel/lib/active_model/observing.rb +++ b/activemodel/lib/active_model/observing.rb @@ -238,8 +238,7 @@ module ActiveModel # Send observed_method(object) if the method exists and # the observer is enabled for the given object's class. def update(observed_method, object, *extra_args, &block) #:nodoc: - return unless respond_to?(observed_method) - return if disabled_for?(object) + return if !respond_to?(observed_method) || disabled_for?(object) send(observed_method, object, *extra_args, &block) end