diff options
author | Yehuda Katz <wycats@mobile-166-129-139-135.mycingular.net> | 2009-11-07 11:23:21 -0800 |
---|---|---|
committer | Yehuda Katz <wycats@mobile-166-129-139-135.mycingular.net> | 2009-11-07 11:23:21 -0800 |
commit | e1b5e3cc709df12d2d8495737e524f60015e6f5c (patch) | |
tree | dbb9452675bb964fdb5025f19372e2677fecc89d /actionpack/lib/action_dispatch/middleware | |
parent | cbded53671bccccbaf7e9fdfa93ef86cb097daa3 (diff) | |
download | rails-e1b5e3cc709df12d2d8495737e524f60015e6f5c.tar.gz rails-e1b5e3cc709df12d2d8495737e524f60015e6f5c.tar.bz2 rails-e1b5e3cc709df12d2d8495737e524f60015e6f5c.zip |
Break up inflector to reduce the dependency burden on dependency-les methods like constantize.
Diffstat (limited to 'actionpack/lib/action_dispatch/middleware')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/stack.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/stack.rb b/actionpack/lib/action_dispatch/middleware/stack.rb index 4f71ea6165..3b27309f58 100644 --- a/actionpack/lib/action_dispatch/middleware/stack.rb +++ b/actionpack/lib/action_dispatch/middleware/stack.rb @@ -1,3 +1,5 @@ +require "active_support/inflector/methods" + module ActionDispatch class MiddlewareStack < Array class Middleware @@ -32,7 +34,7 @@ module ActionDispatch elsif @klass.respond_to?(:call) @klass.call else - @klass.to_s.constantize + ActiveSupport::Inflector.constantize(@klass.to_s) end end @@ -53,7 +55,7 @@ module ActionDispatch when Class klass == middleware else - klass == middleware.to_s.constantize + klass == ActiveSupport::Inflector.constantize(middleware.to_s) end end |