aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2008-11-25 23:50:57 -0800
committerJeremy Kemper <jeremy@bitsweat.net>2008-11-25 23:50:57 -0800
commitad93212f79e98535aa504dfdf6175e8035616abe (patch)
tree8e2e48c7532233c6e697fad94bbaf83b22bd6b36 /activerecord
parentb7fef2610b239db923909cc0fbfc33e6080fe0c4 (diff)
downloadrails-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
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/fixtures.rb8
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