I have a lot of data in my seeds, and have them separated into multiple files. I'm wondering if there is a way I can seed only one of these tables? In Laravel, I know it's possible to separate seeders into classes and then call:
php artisan db:seed --class CertainTableSeeder.
Is there a way to do this in Rails?
I have two files with a lot of seed data, joined through this function in seeds.rb
Dir[File.join(Rails.root, 'db', 'seeds', '*.rb')].sort.each do |seed|
load seed
end
I've tried running commands like
rake db:seed SEED="CountriesTableSeeder.rb"
Only to find that this still reverts to running a normal db:seed, and my seeders are set up to destroy the table before each seed, but I'd rather not destroy the information from all tables each time I seed.