lib/transactionata.rb in transactionata-0.2.0 vs lib/transactionata.rb in transactionata-0.3.0
- old
+ new
@@ -25,10 +25,15 @@
alias_method :original_load_fixtures, :load_fixtures
def load_fixtures
original_load_fixtures
self.class.test_data_block.call
- Fixtures.reset_cache # Required to enforce purging tables for every test file
+
+ if defined?(ActiveRecord::Fixtures) # Rails 3.1
+ ActiveRecord::Fixtures.reset_cache
+ else
+ Fixtures.reset_cache # Required to enforce purging tables for every test file
+ end
end
end
self.test_data_block = blk
end
end
\ No newline at end of file