Regenerate category description / About topic


(Allen Lee) #1

I accidentally deleted several category About topics while attempting to do some data cleaning (via a careless Topic.where(category_id: ).destroy_all where I forgot to exclude the about topic). Is there a way to regenerate these specially pinned topics from the rails console?

Alternatively I guess I could try creating new categories and copying topics over and then deleting the old categories…


(Joshua Rosenfeld) #2

How long ago did you delete them? You could look through the list of deleted topics to try and find and undelete it. It should still have its special properties. If not, a new category is likely easiest. I’ve used that method before. Rename the “old” category and slug temporarily, create the new category using the previous name/slug, move all topics, then delete the old category.

To view deleted topics, go to your.forum.com/latest?status=deleted


(Allen Lee) #3

Must have been too long, so I went the new category route - thanks for confirming!