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 | |
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')
-rwxr-xr-x | actionpack/lib/action_dispatch/http/request.rb | 1 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/stack.rb | 6 |
2 files changed, 5 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/http/request.rb b/actionpack/lib/action_dispatch/http/request.rb index 75be2cc260..9314ff5c53 100755 --- a/actionpack/lib/action_dispatch/http/request.rb +++ b/actionpack/lib/action_dispatch/http/request.rb @@ -6,6 +6,7 @@ require 'active_support/memoizable' require 'active_support/core_ext/array/wrap' require 'active_support/core_ext/hash/indifferent_access' require 'active_support/core_ext/object/tap' +require 'active_support/core_ext/string/access' module ActionDispatch class Request < Rack::Request 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 |