diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-07-03 04:44:33 -0700 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-07-03 04:44:33 -0700 |
commit | eedca4a1467927fce520f567350be0c4b49b9a6f (patch) | |
tree | 2d1d7db63bce4b5b5ce2190e013abc4fc3f018ff /activemodel | |
parent | 55456ad34ac2be56392bce074577ebc0aeb509b2 (diff) | |
parent | 17fa4ef6667e025e3f263cd008538740a5d003ad (diff) | |
download | rails-eedca4a1467927fce520f567350be0c4b49b9a6f.tar.gz rails-eedca4a1467927fce520f567350be0c4b49b9a6f.tar.bz2 rails-eedca4a1467927fce520f567350be0c4b49b9a6f.zip |
Merge pull request #6940 from acapilleri/observer_update
Observer #update refactoring
Diffstat (limited to 'activemodel')
-rw-r--r-- | activemodel/lib/active_model/observing.rb | 3 |
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 |