Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails 3.2 compatability #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/rack_timer/stack.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down