Compare to 0 rather than call zero? to handle nil.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5282 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Jeremy Kemper 2006-10-11 00:29:59 +00:00
parent 629b8af2b0
commit 1117387376
1 changed files with 1 additions and 1 deletions

View File

@ -543,7 +543,7 @@ module Test #:nodoc:
return unless defined?(ActiveRecord::Base) && !ActiveRecord::Base.configurations.blank?
# Rollback changes if a transaction is active.
if use_transactional_fixtures? && !Thread.current['open_transactions'].zero?
if use_transactional_fixtures? && Thread.current['open_transactions'] != 0
ActiveRecord::Base.connection.rollback_db_transaction
Thread.current['open_transactions'] = 0
end