Last active
August 29, 2015 14:02
-
-
Save francois-blanchard/18f7600d389aaafcc4bf to your computer and use it in GitHub Desktop.
Pass argument to rake task in rails
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
$ rake my_task id=user.id |
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
# 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