Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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.
  • Loading branch information...
commit d1887d384a4038d67bcad50a46a6dc67abfebe04 1 parent 39961f8
@drogus drogus authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 activesupport/lib/active_support/rescuable.rb
View
6 activesupport/lib/active_support/rescuable.rb
@@ -108,7 +108,11 @@ def handler_for_rescue(exception)
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
Please sign in to comment.
Something went wrong with that request. Please try again.