Cache instrumenter again as per Aaron's patch.

This commit is contained in:
José Valim 2010-07-25 22:59:50 +02:00
parent 751f89b8b2
commit f4200b0cd5
1 changed files with 2 additions and 1 deletions

View File

@ -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