diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-08-03 08:57:52 -0700 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2011-08-13 16:22:28 -0700 |
commit | 1ff52cbe818f9f7bad2a9ff6ae0e515f82b1ab06 (patch) | |
tree | d3ba7689905e078296fd2ebf84906aeec9b8793c | |
parent | d6af6fc0c03860f677e8fc85fa7eb4bab181215a (diff) | |
download | rails-1ff52cbe818f9f7bad2a9ff6ae0e515f82b1ab06.tar.gz rails-1ff52cbe818f9f7bad2a9ff6ae0e515f82b1ab06.tar.bz2 rails-1ff52cbe818f9f7bad2a9ff6ae0e515f82b1ab06.zip |
initializing @open_transactions in the initialize method
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract_adapter.rb | 6 |
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 |