Delete multiple records from Rails console

command-line, console, ruby-on-rails

Solution

You can do something like `User.delete_all("id > 100 AND id < 200")`.

Problem

I'm trying to delete multiple records in my database from the Rails console. I know i can do User.find(1).destroy. What if I want to delete all users with ids 100 - 200. Is there a way to do this in the console?

Original source