Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed that BenchmarkHelper should use controller.logger instead of @l…

…ogger (which now apparently is gone)
  • Loading branch information...
commit 850aba5473ce14edcd067f16badfa198e2070095 1 parent dc2d693
David Heinemeier Hansson authored
Showing with 5 additions and 3 deletions.
  1. +5 −3 actionpack/lib/action_view/helpers/benchmark_helper.rb
View
8 actionpack/lib/action_view/helpers/benchmark_helper.rb
@@ -21,11 +21,13 @@ module BenchmarkHelper
# You may give an optional logger level as the second argument
# (:debug, :info, :warn, :error); the default value is :info.
def benchmark(message = "Benchmarking", level = :info)
- if @logger
+ if controller.logger
real = Benchmark.realtime { yield }
- @logger.send level, "#{message} (#{'%.5f' % real})"
+ controller.logger.send level, "#{message} (#{'%.5f' % real})"
+ else
+ yield
end
end
end
end
-end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.