diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-03-02 10:11:28 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-03-02 10:11:28 -0800 |
commit | 1f2e7214aaed01f50be12017f0ffbf9fcdbdbb5e (patch) | |
tree | 8c2e018812b254493998e37eb03c8e4a710369c0 /actionpack/lib/action_dispatch | |
parent | 91983724211b0e654c9e79e73bacf10a65adf172 (diff) | |
download | rails-1f2e7214aaed01f50be12017f0ffbf9fcdbdbb5e.tar.gz rails-1f2e7214aaed01f50be12017f0ffbf9fcdbdbb5e.tar.bz2 rails-1f2e7214aaed01f50be12017f0ffbf9fcdbdbb5e.zip |
make sure string keys are always looked up from the class cache
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/stack.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/stack.rb b/actionpack/lib/action_dispatch/middleware/stack.rb index d9bfd3d573..a4308f528c 100644 --- a/actionpack/lib/action_dispatch/middleware/stack.rb +++ b/actionpack/lib/action_dispatch/middleware/stack.rb @@ -4,7 +4,7 @@ require "active_support/dependencies" module ActionDispatch class MiddlewareStack class Middleware - attr_reader :args, :block + attr_reader :args, :block, :name, :classcache def initialize(klass_or_name, *args, &block) @klass = nil @@ -16,11 +16,12 @@ module ActionDispatch @name = klass_or_name.to_s end + @classcache = ActiveSupport::Dependencies::Reference @args, @block = args, block end def klass - @klass ||= ActiveSupport::Inflector.constantize(@name) + @klass || classcache[@name] end def ==(middleware) |