aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller
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_controller
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_controller')
-rw-r--r--actionpack/lib/action_controller/metal.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/metal.rb b/actionpack/lib/action_controller/metal.rb
index f875aa5e6b..b9088e6d86 100644
--- a/actionpack/lib/action_controller/metal.rb
+++ b/actionpack/lib/action_controller/metal.rb
@@ -26,10 +26,10 @@ module ActionController
end
end
- def build(action, app = Proc.new)
+ def build(action, app = nil, &block)
action = action.to_s
- middlewares.reverse.inject(app) do |a, middleware|
+ middlewares.reverse.inject(app || block) do |a, middleware|
middleware.valid?(action) ? middleware.build(a) : a
end
end