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:
parent
39961f8099
commit
d1887d384a
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue