Permalink
Browse files

Rework Middleware stack to match the Rack middleware protocol more cl…

…osely
  • Loading branch information...
1 parent 469424c commit a21aaca8eaa8f451fb0ec4814b51323439bd36ff Yehuda Katz + Carl Lerche committed Aug 26, 2009
Showing with 3 additions and 3 deletions.
  1. +3 −3 actionpack/lib/action_dispatch/middleware/stack.rb
@@ -27,10 +27,10 @@ def initialize(klass, *args, &block)
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

0 comments on commit a21aaca

Please sign in to comment.