From f4200b0cd5c21d7bd37a9b5c9effc2006485ed46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Sun, 25 Jul 2010 22:59:50 +0200 Subject: Cache instrumenter again as per Aaron's patch. --- activerecord/lib/active_record/connection_adapters/abstract_adapter.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'activerecord') 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 -- cgit v1.2.3