Permalink
Browse files

Rename use_transactional_fixtures? so it doesn't collide with the sup…

…erclass_delegating_accessor's query method
  • Loading branch information...
1 parent b7fef26 commit ad93212f79e98535aa504dfdf6175e8035616abe @jeremy jeremy committed Nov 26, 2008
Showing with 4 additions and 4 deletions.
  1. +4 −4 activerecord/lib/active_record/fixtures.rb
@@ -913,7 +913,7 @@ def uses_transaction?(method)
end
end
- def use_transactional_fixtures?
+ def run_in_transaction?
use_transactional_fixtures &&
!self.class.uses_transaction?(method_name)
end
@@ -929,7 +929,7 @@ def setup_fixtures
@@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 @@ def setup_fixtures
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

0 comments on commit ad93212

Please sign in to comment.