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:
Robin Dupret 2015-03-02 17:09:44 +01:00
parent 670b2889a3
commit 6b1ec17526
1 changed files with 1 additions and 1 deletions

View File

@ -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