mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: synonym tags are not considered as unused (#23950)
Currently, `Tag.unused` scope is used to delete unused tags on `/tags` and by CleanUpTags job. Synonym tags, should not be included and treated as unused. Synonyms are only deleted when main tag is deleted: https://github.com/discourse/discourse/blob/main/app/models/tag.rb#L57
This commit is contained in:
committed by
GitHub
parent
ee9aa02ab3
commit
09eca87c76
@@ -30,7 +30,7 @@ class Tag < ActiveRecord::Base
|
||||
# tags that have never been used and don't belong to a tag group
|
||||
scope :unused,
|
||||
-> {
|
||||
where(staff_topic_count: 0, pm_topic_count: 0).joins(
|
||||
where(staff_topic_count: 0, pm_topic_count: 0, target_tag_id: nil).joins(
|
||||
"LEFT JOIN tag_group_memberships tgm ON tags.id = tgm.tag_id",
|
||||
).where("tgm.tag_id IS NULL")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user