Delete everything from all tables (in Activerecord)

Posted by Horace Loeb on Stack Overflow See other posts from Stack Overflow or by Horace Loeb
Published on 2009-07-28T19:14:49Z Indexed on 2010/06/10 23:43 UTC
Read the original article Hit count: 136

So I can do Post.delete_all to delete all my posts, but what if I want to delete all posts, comments, blogs, etc. I.e., how do I iterate over all my models and run the delete_all method?

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about activerecord