From 88dd60298ef393e2406ab543a1124a4304a19f61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Fri, 15 Jan 2010 11:55:11 +0100 Subject: Do not send the whole controller in notifications, cherry pick required pieces. --- activerecord/lib/active_record/railties/controller_runtime.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/railties/controller_runtime.rb b/activerecord/lib/active_record/railties/controller_runtime.rb index a4f4e15c2e..aed1c59b00 100644 --- a/activerecord/lib/active_record/railties/controller_runtime.rb +++ b/activerecord/lib/active_record/railties/controller_runtime.rb @@ -5,6 +5,8 @@ module ActiveRecord module ControllerRuntime extend ActiveSupport::Concern + protected + attr_internal :db_runtime def cleanup_view_runtime @@ -19,9 +21,14 @@ module ActiveRecord end end + def append_info_to_payload(payload) + super + payload[:db_runtime] = db_runtime + end + module ClassMethods - def log_process_action(controller) - messages, db_runtime = super, controller.send(:db_runtime) + def log_process_action(payload) + messages, db_runtime = super, payload[:db_runtime] messages << ("ActiveRecord: %.1fms" % db_runtime.to_f) if db_runtime messages end -- cgit v1.2.3