aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-08-03 08:57:52 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2011-08-03 08:57:52 -0700
commit86b7d83f1ce81284cad37781667a5f204be22273 (patch)
tree7fec2690c8900ca82500b7b94bbbcd7b95fc6c6b /activerecord/lib/active_record/connection_adapters
parent3a29cc341205b7da30c537f31eefb18ede51bb4d (diff)
downloadrails-86b7d83f1ce81284cad37781667a5f204be22273.tar.gz
rails-86b7d83f1ce81284cad37781667a5f204be22273.tar.bz2
rails-86b7d83f1ce81284cad37781667a5f204be22273.zip
initializing @open_transactions in the initialize method
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters')
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract_adapter.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
index 65024d76f8..bde31d1cda 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
@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 @@ module ActiveRecord
@connection
end
- def open_transactions
- @open_transactions ||= 0
- end
+ attr_reader :open_transactions
def increment_open_transactions
- @open_transactions ||= 0
@open_transactions += 1
end