aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/abstract_adapter.rb')
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract_adapter.rb18
1 files changed, 2 insertions, 16 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
index 618560087e..c07ba2ac74 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
@@ -36,15 +36,11 @@ module ActiveRecord
define_callbacks :checkout, :checkin
- @@row_even = true
-
def initialize(connection, logger = nil) #:nodoc:
@active = nil
@connection, @logger = connection, logger
- @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
@@ -93,11 +89,6 @@ module ActiveRecord
false
end
- def reset_runtime #:nodoc:
- rt, @runtime = @runtime, 0
- rt
- end
-
# QUOTING ==================================================
# Override to return the quoted table name. Defaults to column quoting.
@@ -200,15 +191,10 @@ module ActiveRecord
def log(sql, name)
name ||= "SQL"
- info = {}
-
- result = @instrumenter.instrument("sql.active_record",
- {:sql => sql, :name => name, :connection_id => object_id}, info) do
+ ActiveSupport::Notifications.instrument("sql.active_record",
+ :sql => sql, :name => name, :connection_id => object_id) do
yield
end
- @runtime += info[:elapsed]
-
- result
rescue Exception => e
message = "#{e.class.name}: #{e.message}: #{sql}"
@logger.debug message if @logger