Permalink
Browse files

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
  • Loading branch information...
1 parent 629b8af commit 111738737674121343fb1aba2f7883e682d205c1 @jeremy jeremy committed Oct 11, 2006
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/fixtures.rb
View
2 activerecord/lib/active_record/fixtures.rb
@@ -543,7 +543,7 @@ def teardown_with_fixtures
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

0 comments on commit 1117387

Please sign in to comment.