トピックがハード削除される場合は投稿を削除

Hey,

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?

Thanks,
felixoi

「いいね!」 1

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.

「いいね!」 3