From d1887d384a4038d67bcad50a46a6dc67abfebe04 Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Fri, 23 Mar 2012 11:49:25 +0100 Subject: Fix tests, when creating rescue handler, we need to check for arity now Before it was handled by Proc.bind, but since Proc.bind has been deprecated, this is no longer the case and returned handler needs to match rescuer. --- activesupport/lib/active_support/rescuable.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'activesupport/lib') diff --git a/activesupport/lib/active_support/rescuable.rb b/activesupport/lib/active_support/rescuable.rb index 7ed426a90d..0fbe6e5b29 100644 --- a/activesupport/lib/active_support/rescuable.rb +++ b/activesupport/lib/active_support/rescuable.rb @@ -108,7 +108,11 @@ module ActiveSupport when Symbol method(rescuer) when Proc - Proc.new { |*args| instance_exec(*args, &rescuer) } + if rescuer.arity == 0 + Proc.new { instance_exec(&rescuer) } + else + Proc.new { |exception| instance_exec(exception, &rescuer) } + end end end end -- cgit v1.2.3