From 6b1ec17526f19e3aed96e09f2bddeb589e44fc15 Mon Sep 17 00:00:00 2001 From: Robin Dupret Date: Mon, 2 Mar 2015 17:09:44 +0100 Subject: [PATCH] Wrap inline rescue with or-equal calls At the moment, `rescue_from` doesn't work with strings on Rubinius because of rubinius/rubinius#3272. --- activesupport/lib/active_support/rescuable.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activesupport/lib/active_support/rescuable.rb b/activesupport/lib/active_support/rescuable.rb index 1a02acd5b1d..67aac327425 100644 --- a/activesupport/lib/active_support/rescuable.rb +++ b/activesupport/lib/active_support/rescuable.rb @@ -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