Usually We use the great power of rails db:seed
in any Rails project. The seeds
file provides us a way to quickly manipulate our sample and necessary data, especially at the beginning of our project.
But when times gone, we see that we often add more and more data to our seeds
file and we need to rerun the command again. So, we need to comment out the old code in seeds
file, or, we need to strictly validate the models. We absolutely don’t want our seed
data as a mess
That’s why I start investigating the way to separate our seeds into different files, so we can choose whichever seed file we want to run, to void duplication or commenting old code. But we need a way for other programmer who joins our project later to run all of the files.
Let’s move on.
Continue reading Create and run separated seed files