Running Long One-Off Rails Console Commands Detached on Heroku

Ever wanted to run some kind of one-off thing without pushing up a rake task? I came across this today and needed to clear out some database records. This works wonderfully:

heroku run:detached rails runner 'SomeModel.long_running_method' -r heroku

Leave a Reply

Your email address will not be published. Required fields are marked *