1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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.
This commit is contained in:
Piotr Sarnacki 2012-03-23 11:49:25 +01:00
parent 39961f8099
commit d1887d384a

View file

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