Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Rails 3 task to dump (parts) of your database to db/seeds.rb
Pull request Compare This branch is 36 commits ahead, 195 commits behind rroblak:master.
Latest commit 2b5bf74 @kevTheDev Merge pull request #2 from Slike9/master
(FIX) Models with namespaced names dump



Seed dumper is a simple plugin that adds a rake task named db:seed:dump. Forked and simplified from seed_dump. If you require

It allows you to create a db/seeds.rb from your existing data in the database. When there is no data in the database it will generate empty create statements.

It mainly exists for people who are too lazy writing create statements in db/seeds.rb themselves and need something (seed_dump) to dump data from the table(s) into seeds.rb

Example Usage

Dump all data directly to db/seeds.rb:

rake db:seed:dump


$ cat db/seeds.rb 
# Autogenerated by the db:seed:dump task
# Do not hesitate to tweak this to your needs

products = Product.create([
  { :category_id => 1, :description => "Long Sleeve Shirt", :name => "Long Sleeve Shirt" },
  { :category_id => 3, :description => "Plain White Tee Shirt", :name => "Plain T-Shirt" }

users = User.create([
  { :id => 1, :password => "123456", :username => "test_1" },
  { :id => 2, :password => "234567", :username => "tes2" }

Note on Patches/Pull Requests

  • Fork the project.

  • Make your feature addition or bug fix.

  • Add tests for it. This is important so I don't break it in a future version unintentionally.

  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)

  • Send me a pull request. Bonus points for topic branches.

Copyright © 2010 Kevin Edwards, released under the MIT license

Something went wrong with that request. Please try again.