Skip to content
Browse files

use Proc.new to automatically do parameter checking for us

  • Loading branch information...
1 parent 7c26f01 commit 93ae747c597f988b44d80dda16eb44eef1aecd50 @tenderlove tenderlove committed
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

0 comments on commit 93ae747

Please sign in to comment.
Something went wrong with that request. Please try again.