From a39498ae060f07132ddbbc45933a819686f0eb24 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Thu, 19 Feb 2015 02:35:51 +0800 Subject: Allow Rack::Runtime to be deleted from middleware stack. Fixes: https://github.com/rails/rails/issues/16433. --- railties/lib/rails/configuration.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'railties/lib') diff --git a/railties/lib/rails/configuration.rb b/railties/lib/rails/configuration.rb index f99cec04c5..e1ee214dc9 100644 --- a/railties/lib/rails/configuration.rb +++ b/railties/lib/rails/configuration.rb @@ -35,6 +35,7 @@ module Rails class MiddlewareStackProxy def initialize @operations = [] + @delete_operations = [] end def insert_before(*args, &block) @@ -56,7 +57,7 @@ module Rails end def delete(*args, &block) - @operations << [__method__, args, block] + @delete_operations << [__method__, args, block] end def unshift(*args, &block) @@ -64,9 +65,10 @@ module Rails end def merge_into(other) #:nodoc: - @operations.each do |operation, args, block| + @operations.concat(@delete_operations).each do |operation, args, block| other.send(operation, *args, &block) end + other end end -- cgit v1.2.3