Permalink
Browse files

initializing @open_transactions in the initialize method

  • Loading branch information...
1 parent d6af6fc commit 1ff52cbe818f9f7bad2a9ff6ae0e515f82b1ab06 @tenderlove tenderlove committed with fxn Aug 3, 2011
Showing with 2 additions and 4 deletions.
  1. +2 −4 activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
@@ -43,6 +43,7 @@ def initialize(connection, logger = nil) #:nodoc:
@connection, @logger = connection, logger
@query_cache_enabled = false
@query_cache = Hash.new { |h,sql| h[sql] = {} }
+ @open_transactions = 0
@instrumenter = ActiveSupport::Notifications.instrumenter
end
@@ -177,12 +178,9 @@ def raw_connection
@connection
end
- def open_transactions
- @open_transactions ||= 0
- end
+ attr_reader :open_transactions
def increment_open_transactions
- @open_transactions ||= 0
@open_transactions += 1
end

0 comments on commit 1ff52cb

Please sign in to comment.