Delete posts if topics are getting hard deleted


due to an error with using the api we got spammed by moderation topics (~2000 new “was flagged as” topics). I want to hard delete them from the database. When I’m running Topic.find_by(title: ‘Title’).destroy it destroys the topic only but not the posts in the topic. Is there a way to remove everything which is associated with the topics?


1 Like

I think if you delete them it’ll delete the topics. I guess to destroy the posts too you’ll need to loop through them or do a find for the topic id do a destroy_all.