Skip to content

Instantly share code, notes, and snippets.

@francois-blanchard
Last active August 29, 2015 14:02
Show Gist options
  • Save francois-blanchard/18f7600d389aaafcc4bf to your computer and use it in GitHub Desktop.
Save francois-blanchard/18f7600d389aaafcc4bf to your computer and use it in GitHub Desktop.
Pass argument to rake task in rails
$ rake my_task id=user.id
# lib/tasks/task.rake
task my_task: :environment do
id = ENV['user_id']
...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment