1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Rework Middleware stack to match the Rack middleware protocol more closely

This commit is contained in:
Yehuda Katz + Carl Lerche 2009-08-25 17:04:09 -07:00
parent 469424c85e
commit a21aaca8ea

View file

@ -27,10 +27,10 @@ module ActionDispatch
end end
def klass def klass
if @klass.respond_to?(:call) if @klass.respond_to?(:new)
@klass.call
elsif @klass.is_a?(Class)
@klass @klass
elsif @klass.respond_to?(:call)
@klass.call
else else
@klass.to_s.constantize @klass.to_s.constantize
end end