In my case, I used the file in listing 4 to seed the database before running my component tests and then used the same file to indicate which data to delete from the database upon test completion.
在本文的例子中,将在运行组件测试前使用清单4中的文件在数据库中播种,然后使用相同的文件指示测试完成时从数据库中删除哪些数据。
This release also includes a new feature for adding seed data to a project database with a simple rake db: seed command.
这个版本也包括了一个新特性,能够通过一个简单的rake db: seed命令将seed数据添加到项目数据库。
Prior to the seed file, no convention existed for initialization, and many developers put code in migrations, clouding the differentiation between creating the database and populating it.
在Seed文件之前,不存在初始化的惯例,许多开发人员把代码放入迁移中,这样容易混淆创建数据库和填充数据库之间的不同之处。
应用推荐