1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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

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