aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib
diff options
context:
space:
mode:
authorAngelo Capilleri <capilleri@yahoo.com>2012-07-03 09:08:33 +0200
committerAngelo Capilleri <capilleri@yahoo.com>2012-07-03 09:08:33 +0200
commit17fa4ef6667e025e3f263cd008538740a5d003ad (patch)
treef2a4e6acada03c060f7005e5424dd2a6346c4f23 /activemodel/lib
parentb8a5bb2c5e798ff855182aa003e7fdc52d44bf57 (diff)
downloadrails-17fa4ef6667e025e3f263cd008538740a5d003ad.tar.gz
rails-17fa4ef6667e025e3f263cd008538740a5d003ad.tar.bz2
rails-17fa4ef6667e025e3f263cd008538740a5d003ad.zip
observer update refactoring
Diffstat (limited to 'activemodel/lib')
-rw-r--r--activemodel/lib/active_model/observing.rb3
1 files changed, 1 insertions, 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