diff options
author | Guillermo Iguaran <guilleiguaran@gmail.com> | 2015-02-19 00:18:05 -0500 |
---|---|---|
committer | Guillermo Iguaran <guilleiguaran@gmail.com> | 2015-02-19 00:18:05 -0500 |
commit | 06d5d2c5e9cfcd92ba239703c0d699d17a90621e (patch) | |
tree | 1e737bc0174919218a63741a1cc6590eefc30f4f /railties/lib | |
parent | 22a347d44aad55760044acf25e058ca8976b3c82 (diff) | |
parent | a39498ae060f07132ddbbc45933a819686f0eb24 (diff) | |
download | rails-06d5d2c5e9cfcd92ba239703c0d699d17a90621e.tar.gz rails-06d5d2c5e9cfcd92ba239703c0d699d17a90621e.tar.bz2 rails-06d5d2c5e9cfcd92ba239703c0d699d17a90621e.zip |
Merge pull request #18994 from tgxworld/run_delete_middleware_operations_last
Allow Rack::Runtime to be deleted from middleware stack.
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails/configuration.rb | 6 |
1 files changed, 4 insertions, 2 deletions
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 |