mirror of https://github.com/rails/rails
Wrap inline rescue with or-equal calls
At the moment, `rescue_from` doesn't work with strings on Rubinius because of rubinius/rubinius#3272.
This commit is contained in:
parent
670b2889a3
commit
6b1ec17526
|
@ -100,7 +100,7 @@ module ActiveSupport
|
|||
# a string, otherwise a NameError will be raised by the interpreter
|
||||
# itself when rescue_from CONSTANT is executed.
|
||||
klass = self.class.const_get(klass_name) rescue nil
|
||||
klass ||= klass_name.constantize rescue nil
|
||||
klass ||= (klass_name.constantize rescue nil)
|
||||
klass === exception if klass
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue