aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/railties
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-05-14 03:57:24 -0700
committerJosé Valim <jose.valim@gmail.com>2011-05-14 03:57:24 -0700
commitc4837f6ce3f9864c4b98c9051f99e1f0b428f9d6 (patch)
tree6e902ccc598cf02e2f28fcb4dab7145b01619357 /activerecord/lib/active_record/railties
parentd49113023676fbf0b6653730f5bde759990caede (diff)
parent6d961242848ffe0eac69f190fd02f44aaeef3e0a (diff)
downloadrails-c4837f6ce3f9864c4b98c9051f99e1f0b428f9d6.tar.gz
rails-c4837f6ce3f9864c4b98c9051f99e1f0b428f9d6.tar.bz2
rails-c4837f6ce3f9864c4b98c9051f99e1f0b428f9d6.zip
Merge pull request #554 from tomafro/reset-activerecord-runtime-before-each-request
ActiveRecord::LogSubscriber.runtime should be reset at the start of each request
Diffstat (limited to 'activerecord/lib/active_record/railties')
-rw-r--r--activerecord/lib/active_record/railties/controller_runtime.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/railties/controller_runtime.rb b/activerecord/lib/active_record/railties/controller_runtime.rb
index bc6ca936c0..a0eecf4f46 100644
--- a/activerecord/lib/active_record/railties/controller_runtime.rb
+++ b/activerecord/lib/active_record/railties/controller_runtime.rb
@@ -9,6 +9,11 @@ module ActiveRecord
attr_internal :db_runtime
+ def process_action(action, *args)
+ ActiveRecord::LogSubscriber.reset_runtime
+ super
+ end
+
def cleanup_view_runtime
if ActiveRecord::Base.connected?
db_rt_before_render = ActiveRecord::LogSubscriber.reset_runtime