namespace :playcricket do
desc 'build legacy data to new'
task :rebuild_database => ["playcricket:sample1", "playcricket:sample2", "playcricket:sample3"]
desc "first sample task"
task :sample1 => :environment do
puts "sample1 executed"
end
desc "second sample task"
task :sample2 => :environment do
puts "sample2 executed"
end
desc "call another rake task with arguments"
task :sample3 => :environment do
puts "sample3 executed"
Rake::Task["playcricket:sample4"].invoke("333")
end
desc "rake task with argument"
# => sample rake playcricket:sample4["767"]
task :sample4, [:sg_group_id] => :environment do |t, args|
puts "Migrating Data"
puts args[:sg_group_id]
end
end
desc 'build legacy data to new'
task :rebuild_database => ["playcricket:sample1", "playcricket:sample2", "playcricket:sample3"]
desc "first sample task"
task :sample1 => :environment do
puts "sample1 executed"
end
desc "second sample task"
task :sample2 => :environment do
puts "sample2 executed"
end
desc "call another rake task with arguments"
task :sample3 => :environment do
puts "sample3 executed"
Rake::Task["playcricket:sample4"].invoke("333")
end
desc "rake task with argument"
# => sample rake playcricket:sample4["767"]
task :sample4, [:sg_group_id] => :environment do |t, args|
puts "Migrating Data"
puts args[:sg_group_id]
end
end