Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #6940 from acapilleri/observer_update

Observer #update refactoring
  • Loading branch information...
commit eedca4a1467927fce520f567350be0c4b49b9a6f 2 parents 55456ad + 17fa4ef
@carlosantoniodasilva carlosantoniodasilva authored
Showing with 1 addition and 2 deletions.
  1. +1 −2  activemodel/lib/active_model/observing.rb
View
3  activemodel/lib/active_model/observing.rb
@@ -238,8 +238,7 @@ def observed_classes #:nodoc:
# 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
Please sign in to comment.
Something went wrong with that request. Please try again.