aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/railties
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-01-15 11:55:11 +0100
committerJosé Valim <jose.valim@gmail.com>2010-01-15 12:24:31 +0100
commit88dd60298ef393e2406ab543a1124a4304a19f61 (patch)
treeea7979db59c367dcda4a51306953039c6f85c932 /activerecord/lib/active_record/railties
parent704daad76208f4581c8169e2cdca096ed804beb4 (diff)
downloadrails-88dd60298ef393e2406ab543a1124a4304a19f61.tar.gz
rails-88dd60298ef393e2406ab543a1124a4304a19f61.tar.bz2
rails-88dd60298ef393e2406ab543a1124a4304a19f61.zip
Do not send the whole controller in notifications, cherry pick required pieces.
Diffstat (limited to 'activerecord/lib/active_record/railties')
-rw-r--r--activerecord/lib/active_record/railties/controller_runtime.rb11
1 files changed, 9 insertions, 2 deletions
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