Search code examples
ruby-on-railsactiverecordruby-on-rails-3rake

Create seed file from data already in the database


I'm using Rails 3.0.3 and have data for my "categories" table already in the database, but want to create a seed file from it. Is there any rake task that will generate the seeds.rb format for me from this table?


Solution

  • There is a gem called seed_dump, which will do exactly what you want: