Truncate table(s) with rails console

前端 未结 9 1342
北恋
北恋 2021-02-02 05:51

I have this testingdatabase which, by now, is stuffed with junk. Now I\'ve done a few Table.destroy_all commands in the rails console which deletes all records and dependencies

9条回答
  •  被撕碎了的回忆
    2021-02-02 06:27

    Simply rebuild the database on the next test run (this will happen automatically after dropping it).

    rake db:drop RAILS_ENV=test

提交回复
热议问题