use Proc.new to automatically do parameter checking for us
This commit is contained in:
parent
7c26f0141c
commit
93ae747c59
|
@ -30,10 +30,8 @@ module ActionController
|
|||
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
|
||||
|
|
Loading…
Reference in New Issue