Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

use Proc.new to automatically do parameter checking for us

  • Loading branch information...
commit 93ae747c597f988b44d80dda16eb44eef1aecd50 1 parent 7c26f01
@tenderlove tenderlove authored
Showing with 1 addition and 3 deletions.
  1. +1 −3 actionpack/lib/action_controller/metal.rb
View
4 actionpack/lib/action_controller/metal.rb
@@ -30,10 +30,8 @@ def valid?(action)
end
end
- def build(action, app=nil, &block)
- app ||= block
+ def build(action, app = Proc.new)
action = action.to_s
- raise "MiddlewareStack#build requires an app" unless app
middlewares.reverse.inject(app) do |a, middleware|
middleware.valid?(action) ? middleware.build(a) : a
Please sign in to comment.
Something went wrong with that request. Please try again.