mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 01:56:58 +08:00
FEATURE: Allow multiple required tag groups for a category (#16381)
Previously we only supported a single 'required tag group' for a category. This commit allows admins to specify multiple required tag groups, each with their own minimum tag count. A new category_required_tag_groups database table replaces the existing columns on the categories table. Data is automatically migrated.
This commit is contained in:
@ -1123,7 +1123,7 @@ describe PostRevisor do
|
||||
fab!(:tag2) { Fabricate(:tag) }
|
||||
fab!(:tag3) { Fabricate(:tag) }
|
||||
fab!(:tag_group) { Fabricate(:tag_group, tags: [tag1, tag2]) }
|
||||
fab!(:category) { Fabricate(:category, name: "beta", required_tag_group: tag_group, min_tags_from_required_group: 1) }
|
||||
fab!(:category) { Fabricate(:category, name: "beta", category_required_tag_groups: [CategoryRequiredTagGroup.new(tag_group: tag_group, min_count: 1)]) }
|
||||
|
||||
before do
|
||||
post.topic.update(category: category)
|
||||
|
Reference in New Issue
Block a user