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

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -