1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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

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