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:
parent
629b8af2b0
commit
1117387376
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue