4

I have tried scouring the mighty google, but can't seem to find what I am looking for (probably because what I am wanting to do is stupid)

But, is there a way to create a seed file from just a single database table instead of dumping the entire database contents?

Essentially, I have a Products table and I am just wanting to generate a seed file from this table.

dennismonsewicz
  • 25,132
  • 33
  • 116
  • 189

1 Answers1

4

Found what I was looking for using this Rails Gem https://github.com/rhalff/seed_dump

Use this Code:
rake db:seed:dump MODELS=User

Obviously replace User with the model name you are wanting to work with, or a comma separated list of models.

dennismonsewicz
  • 25,132
  • 33
  • 116
  • 189