diff --git a/actionpack/lib/action_dispatch/middleware/stack.rb b/actionpack/lib/action_dispatch/middleware/stack.rb index ade2d6f05e..4f71ea6165 100644 --- a/actionpack/lib/action_dispatch/middleware/stack.rb +++ b/actionpack/lib/action_dispatch/middleware/stack.rb @@ -27,10 +27,10 @@ module ActionDispatch end def klass - if @klass.respond_to?(:call) - @klass.call - elsif @klass.is_a?(Class) + if @klass.respond_to?(:new) @klass + elsif @klass.respond_to?(:call) + @klass.call else @klass.to_s.constantize end