ruby-on-rails - 什么是 rake db :test:prepare actually do?

标签 ruby-on-rails ruby

我正在观看 Rails 教程视频,但我无法弄清楚 db:test:prepare 命令的实际作用。有人可以提供解释吗?

最佳答案

The rake db:migrate above runs any pending migrations on the development environment and updates db/schema.rb. The rake db:test:load recreates the test database from the current db/schema.rb. On subsequent attempts, it is a good idea to first run db:test:prepare, as it first checks for pending migrations and warns you appropriately.

-- http://guides.rubyonrails.org/testing.html

基本上它处理克隆数据库,因此您不必针对测试运行迁移来更新测试数据库。

关于ruby-on-rails - 什么是 rake db :test:prepare actually do?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15169894/

相关文章:

ruby - 将数字的 JSON 序列化强制到特定精度

ruby-on-rails - 使用 Ruby on Rails 在 URL 中包含 belongs_to 模型对象的名称

ruby-on-rails - Ruby on Rails 继承语法

ruby-on-rails - 未 checkout ... bundle install 不修复帮助!

ruby-on-rails - 如何防止错误 "code converter not found (UTF-8)"?

ruby-on-rails - 可以在 Ruby on Rails 中只注释一个模型吗?

ruby-on-rails - ruby rails : is there a way to pass a method pointer to a function?

ruby 任务使用 100% 的 CPU - macbook 正在运行

ruby-on-rails - Nginx Rails 错误

ruby-on-rails - omn​​iauth-facebook+devise 回调没有被执行