diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-11-25 23:50:57 -0800 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-11-25 23:50:57 -0800 |
commit | ad93212f79e98535aa504dfdf6175e8035616abe (patch) | |
tree | 8e2e48c7532233c6e697fad94bbaf83b22bd6b36 | |
parent | b7fef2610b239db923909cc0fbfc33e6080fe0c4 (diff) | |
download | rails-ad93212f79e98535aa504dfdf6175e8035616abe.tar.gz rails-ad93212f79e98535aa504dfdf6175e8035616abe.tar.bz2 rails-ad93212f79e98535aa504dfdf6175e8035616abe.zip |
Rename use_transactional_fixtures? so it doesn't collide with the superclass_delegating_accessor's query method
-rw-r--r-- | activerecord/lib/active_record/fixtures.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb index aefb8d4a10..129306d335 100644 --- a/activerecord/lib/active_record/fixtures.rb +++ b/activerecord/lib/active_record/fixtures.rb @@ -913,7 +913,7 @@ module ActiveRecord end end - def use_transactional_fixtures? + def run_in_transaction? use_transactional_fixtures && !self.class.uses_transaction?(method_name) end @@ -929,7 +929,7 @@ module ActiveRecord @@already_loaded_fixtures ||= {} # Load fixtures once and begin transaction. - if use_transactional_fixtures? + if run_in_transaction? if @@already_loaded_fixtures[self.class] @loaded_fixtures = @@already_loaded_fixtures[self.class] else @@ -952,12 +952,12 @@ module ActiveRecord def teardown_fixtures return unless defined?(ActiveRecord) && !ActiveRecord::Base.configurations.blank? - unless use_transactional_fixtures? + unless run_in_transaction? Fixtures.reset_cache end # Rollback changes if a transaction is active. - if use_transactional_fixtures? && ActiveRecord::Base.connection.open_transactions != 0 + if run_in_transaction? && ActiveRecord::Base.connection.open_transactions != 0 ActiveRecord::Base.connection.rollback_db_transaction ActiveRecord::Base.connection.decrement_open_transactions end |