Hacker News new | ask | show | jobs
by vassy 4384 days ago
This is so useful, thanks! Can it get existing data from the database? Or does it only translate the seeds.rb file? I've been using https://github.com/rroblak/seed_dump in the past.
1 comments

It's key to migrate seeds on a "clean" database. Any models you register will be exported from the database into the seeds file, so we usually rake db:reset before running rake seed:migrate on development systems. We actually built this gem almost a year into our current system, so our first bootstrap of this loaded all the records from our production database for the models we needed (products, shipping types, etc.), which gave us a clean seeds file to use on development and test systems.