Skip to content

Commit

Permalink
observer update refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
acapilleri committed Jul 3, 2012
1 parent b8a5bb2 commit 17fa4ef
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions activemodel/lib/active_model/observing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 17fa4ef

Please sign in to comment.