aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorYehuda Katz <wycats@gmail.com>2009-10-27 21:01:31 -0700
committerYehuda Katz <wycats@gmail.com>2009-10-27 21:04:53 -0700
commitcbcb947b00a7c6992cfe42c6b369e87b4fa4ee23 (patch)
tree303df6f42810dc11a6dfd545c0740046ea07db6a /actionpack/lib
parent9b67b7ba2f74067235c8bd8f9dc02fb6337eda52 (diff)
downloadrails-cbcb947b00a7c6992cfe42c6b369e87b4fa4ee23.tar.gz
rails-cbcb947b00a7c6992cfe42c6b369e87b4fa4ee23.tar.bz2
rails-cbcb947b00a7c6992cfe42c6b369e87b4fa4ee23.zip
AS::Notifications.subscribe blocks are now yielded the arguments to pass to AS::Notifications::Event.new
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_controller/notifications.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/notifications.rb b/actionpack/lib/action_controller/notifications.rb
index 4ec88193d5..1a4f29e0e2 100644
--- a/actionpack/lib/action_controller/notifications.rb
+++ b/actionpack/lib/action_controller/notifications.rb
@@ -1,6 +1,8 @@
require 'active_support/notifications'
-ActiveSupport::Notifications.subscribe(/(read|write|cache|expire|exist)_(fragment|page)\??/) do |event|
+ActiveSupport::Notifications.subscribe(/(read|write|cache|expire|exist)_(fragment|page)\??/) do |*args|
+ event = ActiveSupport::Notifications::Event.new(*args)
+
if logger = ActionController::Base.logger
human_name = event.name.to_s.humanize
logger.info("#{human_name} (%.1fms)" % event.duration)