diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2016-10-10 02:10:20 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-10 02:10:20 -0300 |
commit | 0cbb0be329e1375e415ad37c9c20ea9f74ff1ac3 (patch) | |
tree | 0d0363ee64c840cadf9e0e0d7e32de95633287ae /actionpack/lib/action_dispatch/middleware/stack.rb | |
parent | 034e4d38b508cbf2a8eaa9742df3e1948e482827 (diff) | |
parent | de9542acd56f60d281465a59eac11e15ca8b3323 (diff) | |
download | rails-0cbb0be329e1375e415ad37c9c20ea9f74ff1ac3.tar.gz rails-0cbb0be329e1375e415ad37c9c20ea9f74ff1ac3.tar.bz2 rails-0cbb0be329e1375e415ad37c9c20ea9f74ff1ac3.zip |
Merge pull request #26746 from rails/deprecations
Remove all deprecations from Action Pack
Diffstat (limited to 'actionpack/lib/action_dispatch/middleware/stack.rb')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/stack.rb | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/stack.rb b/actionpack/lib/action_dispatch/middleware/stack.rb index 466eb8b3f1..6949b31e75 100644 --- a/actionpack/lib/action_dispatch/middleware/stack.rb +++ b/actionpack/lib/action_dispatch/middleware/stack.rb @@ -88,7 +88,6 @@ module ActionDispatch end def delete(target) - target = get_class target middlewares.delete_if { |m| m.klass == target } end @@ -103,31 +102,13 @@ module ActionDispatch private def assert_index(index, where) - index = get_class index i = index.is_a?(Integer) ? index : middlewares.index { |m| m.klass == index } raise "No such middleware to insert #{where}: #{index.inspect}" unless i i end - def get_class(klass) - if klass.is_a?(String) || klass.is_a?(Symbol) - classcache = ActiveSupport::Dependencies::Reference - converted_klass = classcache[klass.to_s] - ActiveSupport::Deprecation.warn <<-eowarn -Passing strings or symbols to the middleware builder is deprecated, please change -them to actual class references. For example: - - "#{klass}" => #{converted_klass} - - eowarn - converted_klass - else - klass - end - end - def build_middleware(klass, args, block) - Middleware.new(get_class(klass), args, block) + Middleware.new(klass, args, block) end end end |