From e953275edb7257ebc28487411230c52b6bd64ddf Mon Sep 17 00:00:00 2001 From: Jim Neath Date: Mon, 23 Jul 2012 11:15:49 +0100 Subject: [PATCH] Rails 3.2 compatability --- lib/rack_timer/stack.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/rack_timer/stack.rb b/lib/rack_timer/stack.rb index 72f42e2..48ce410 100644 --- a/lib/rack_timer/stack.rb +++ b/lib/rack_timer/stack.rb @@ -1,5 +1,5 @@ module ActionDispatch - class MiddlewareStack < Array + class MiddlewareStack # this class will wrap around each Rack-based middleware and take timing snapshots of how long # each middleware takes to execute @@ -70,7 +70,7 @@ def build(app) def build(app = nil, &block) app ||= block raise "MiddlewareStack#build requires an app" unless app - reverse.inject(RackTimer.new(app)) { |a, e| e.build(a) } + self.to_a.reverse.inject(RackTimer.new(app)) { |a, e| e.build(a) } end end