Created
May 12, 2016 23:38
-
-
Save germs12/6ba59740075b8dba84010e66005c9c04 to your computer and use it in GitHub Desktop.
Call rake tasks with rake tasks that have arguments
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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