ruby on rails - Add sub-task rake -
i'm using rails 4 , need add subtask seeding our database using demo data (for product demo's). want make subtask called rake db:seed:demo
, how can this?
i tried subtask using code, got error rake saying task not found.
#!/usr/bin/env rake # add own tasks in files placed in lib/tasks ending in .rake, # example lib/tasks/capistrano.rake, , automatically available rake. require file.expand_path('../config/application', __file__) api::application.load_tasks task :demo => :seed end task :seed => :db
use namespace
directive:
namespace :db namespace :seed task :demo end end end
Comments
Post a Comment