Permalink
Browse files

observer update refactoring

  • Loading branch information...
acapilleri committed Jul 3, 2012
1 parent b8a5bb2 commit 17fa4ef6667e025e3f263cd008538740a5d003ad
Showing with 1 addition and 2 deletions.
  1. +1 −2 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

0 comments on commit 17fa4ef

Please sign in to comment.