# テストデータクリア
User.delete_all
# id初期化
User.connection.execute("delete from sqlite_sequence where name='members'")
# テストデータ作成
User.create!(...)
More than 5 years have passed since last update.
rake db:seedでテストデータをテーブルに追加するとき、自動採番されるidを初期化する
Last updated at Posted at 2014-08-31
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme
List of users who liked
55