Bulk delete/merge topics via console


#1

Is there a way to delete a non-empty category along with all its topics, possibly via console?

Also, the command to merge two categories is still this one, right?

cat_f = Category.find_by_slug('help')
cat_t = Category.find_by_slug('support')

Topic.where(category_id: cat_f.id).update_all(category_id: cat_t.id)
exit

(Jeff Atwood) #2

This is something I asked @techapj to look at, as part of a customer request to remove an old beta and old alpha categories.


#3

Sorry for the bump but this is the only topic looking for the same thing as I’m:
How can I delete a whole category with all sub-category’s and topics?