diff options
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/rescuable.rb | 6 |
1 files changed, 5 insertions, 1 deletions
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 |