aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2019-03-10 16:31:15 +0100
committerGitHub <noreply@github.com>2019-03-10 16:31:15 +0100
commitc87f6841b77e5827ca7bd03a629e2d615fae0d06 (patch)
tree8e62191b003d0dd096578566f891b66449191a57 /actionpack/lib/action_dispatch
parent08a93efab6bdf10ba7afafb6e51f4b7809c97ebc (diff)
parentc99e673902539a0bb1762a8786671f812076c2d9 (diff)
downloadrails-c87f6841b77e5827ca7bd03a629e2d615fae0d06.tar.gz
rails-c87f6841b77e5827ca7bd03a629e2d615fae0d06.tar.bz2
rails-c87f6841b77e5827ca7bd03a629e2d615fae0d06.zip
Merge pull request #35121 from utilum/warning_tried_to_create_proc_without_block
Ruby 2.7 warning: creating a Proc without a block
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r--actionpack/lib/action_dispatch/middleware/stack.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/stack.rb b/actionpack/lib/action_dispatch/middleware/stack.rb
index b82f8aa3a3..7a2fcd6db7 100644
--- a/actionpack/lib/action_dispatch/middleware/stack.rb
+++ b/actionpack/lib/action_dispatch/middleware/stack.rb
@@ -97,8 +97,8 @@ module ActionDispatch
middlewares.push(build_middleware(klass, args, block))
end
- def build(app = Proc.new)
- middlewares.freeze.reverse.inject(app) { |a, e| e.build(a) }
+ def build(app = nil, &block)
+ middlewares.freeze.reverse.inject(app || block) { |a, e| e.build(a) }
end
private