mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
observer update refactoring
This commit is contained in:
parent
b8a5bb2c5e
commit
17fa4ef666
1 changed files with 1 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue