ActiveRecord::Base.connection.update('SET FOREIGN_KEY_CHECKS = 0')
This switches off foreign key constraints (on MySQL anyway) meaning that your tests can load and reload fixtures to their heart's content, without getting hung up on the order of inserts and deletes.
No comments:
Post a Comment