Skip to content

Instantly share code, notes, and snippets.

@germs12
Created May 12, 2016 23:38
Show Gist options
  • Save germs12/6ba59740075b8dba84010e66005c9c04 to your computer and use it in GitHub Desktop.
Save germs12/6ba59740075b8dba84010e66005c9c04 to your computer and use it in GitHub Desktop.
Call rake tasks with rake tasks that have arguments
namespace :import do
desc 'Checks all pre-exsisting campaigns funded_text'
task :account_images, [:account_id] => [:environment] do |t, arg|
puts "Arg is: #{arg[:account_id]}"
end
desc 'Checks all pre-exsisting campaigns funded_text'
task :account_image_images, [:account_id] => [:environment] do |t, arg|
puts "Arg is: #{arg[:account_id]}"
end
desc 'Checks all pre-exsisting campaigns funded_text'
task :account_documents, [:account_id] => [:environment] do |t, arg|
puts "Arg is: #{arg[:account_id]}"
end
desc 'asdf'
task :all_of_them, [:account_id] => [:environment] do |t, arg|
puts "Arg is: #{arg[:account_id]}"
Rake::Task["import:account_images"].invoke(arg[:account_id])
Rake::Task["import:account_image_images"].invoke(arg[:account_id])
Rake::Task["import:account_documents"].invoke(arg[:account_id])
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment