diff options
author | José Valim <jose.valim@gmail.com> | 2012-05-17 23:45:43 -0700 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2012-05-17 23:45:43 -0700 |
commit | a6a8957132f86684fd15fbfa2737350b8a07cc5b (patch) | |
tree | e20508a1ac70ec40be636faec79a20e771e2adc4 /actionpack/lib | |
parent | 6bb86e1f3f7f9e11ee1c056d8742125173ecbce1 (diff) | |
parent | 793205cccfb3addd8f6aca59d60655b55e4fc38e (diff) | |
download | rails-a6a8957132f86684fd15fbfa2737350b8a07cc5b.tar.gz rails-a6a8957132f86684fd15fbfa2737350b8a07cc5b.tar.bz2 rails-a6a8957132f86684fd15fbfa2737350b8a07cc5b.zip |
Merge pull request #6372 from richo/bugs/middleware_stack_as_array
Add some common Array methods to the middleware stack
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/stack.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/stack.rb b/actionpack/lib/action_dispatch/middleware/stack.rb index 12bc438be3..bbf734f103 100644 --- a/actionpack/lib/action_dispatch/middleware/stack.rb +++ b/actionpack/lib/action_dispatch/middleware/stack.rb @@ -75,6 +75,11 @@ module ActionDispatch middlewares[i] end + def unshift(*args, &block) + middleware = self.class::Middleware.new(*args, &block) + middlewares.unshift(middleware) + end + def initialize_copy(other) self.middlewares = other.middlewares.dup end |