Search code examples
ruby-on-railsherokudevise

Rails, Devise, Heroku deleting user account from Console


I have some empty user accounts sitting in my production environment that I made as a test, that I'd like to delete now. They don't have any items that are attached to them, so what command do I run from the heroku console to delete these? Also, I access the heroku console by just typing 'heroku console', right?

I deleted the "User Delete" button from the devise view because I didn't want users to be able to delete their accounts... Figured this was the cleanest way.


Solution

  • It seems like the easiest way is to open a heroku console and delete manually each user you want to delete. I would advise you to be extremely careful since it is a production environment.

    heroku run console -a <YOUR APP NAME>
    User.find(list_of_ids).destroy_all