I'm using the Seed Dump gem to dump some seed data to db/seeds.rb. Except, I need to run a one-line task after I dump these three tables.
The way I invoke db:seed:dump is this:
zeus rake db:seed:dump MODELS=Standard,Category,Brand So I tried to override this as follows in lib/tasks/database.rake:
namespace :db do namespace :seed do task(:dump_setup => :environment) do Rake::Task["db:seed:dump"].invoke(:models => "Standard,Category,Brand") puts "did it." end end end I have also tried:
namespace :db do namespace :seed do task(:dump_setup => :environment) do Rake::Task["db:seed:dump"].invoke(:models => ['Standard','Category','Brand']) puts "did it." end end end I just have the "did it" there as a placeholder until I get this working.
That invocation is not working. It's dumping hundreds of megabytes from my database. Dumping everything.
The work I've done above is based on the most popular answers I have found here. Not sure why it's working.