Convert all existing topics in category to wikis

Ciao matenauta :slight_smile:

Sì, sarebbe possibile utilizzando la logica qui:

https://meta.discourse.org/t/administrative-bulk-operations/118349#move-all-topics-with-a-specific-tag-to-a-single-category-15

Esempio (testato e funzionante):

TAG = Tag.find_by_name("design")
topics_id = Topic.joins(:topic_tags).where("topic_tags.tag_id = ?", tag.id).pluck(:id)
Post.where(topic_id: topics_id, post_number: 1).update_all(wiki: true)
2 Mi Piace