From a21aaca8eaa8f451fb0ec4814b51323439bd36ff Mon Sep 17 00:00:00 2001 From: Yehuda Katz + Carl Lerche Date: Tue, 25 Aug 2009 17:04:09 -0700 Subject: [PATCH] Rework Middleware stack to match the Rack middleware protocol more closely --- actionpack/lib/action_dispatch/middleware/stack.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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