aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-07-25 22:59:50 +0200
committerJosé Valim <jose.valim@gmail.com>2010-07-25 23:00:15 +0200
commitf4200b0cd5c21d7bd37a9b5c9effc2006485ed46 (patch)
tree046acbe779674deaa9f2ed9ca538e44d604e4657 /activerecord
parent751f89b8b28634cb237d1e47f33ddefaa13829dc (diff)
downloadrails-f4200b0cd5c21d7bd37a9b5c9effc2006485ed46.tar.gz
rails-f4200b0cd5c21d7bd37a9b5c9effc2006485ed46.tar.bz2
rails-f4200b0cd5c21d7bd37a9b5c9effc2006485ed46.zip
Cache instrumenter again as per Aaron's patch.
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract_adapter.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
index c103fcccf7..69a963c3d3 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
@@ -43,6 +43,7 @@ module ActiveRecord
@runtime = 0
@query_cache_enabled = false
@query_cache = {}
+ @instrumenter = ActiveSupport::Notifications.instrumenter
end
# Returns the human-readable name of the adapter. Use mixed case - one
@@ -198,7 +199,7 @@ module ActiveRecord
def log(sql, name)
name ||= "SQL"
- ActiveSupport::Notifications.instrument("sql.active_record",
+ @instrumenter.instrument("sql.active_record",
:sql => sql, :name => name, :connection_id => object_id) do
yield
end