Tags: remove aliases when deprecating a tag

This commit is contained in:
nonamethanks
2022-10-19 18:36:06 +02:00
parent 412b7f2727
commit 7ebf0002cf
2 changed files with 4 additions and 1 deletions

View File

@@ -217,6 +217,7 @@ class BulkUpdateRequestProcessor
when :deprecate
tag = Tag.find_or_create_by_name(args[0])
tag.update!(is_deprecated: true, updater: User.system)
TagAlias.active.where(consequent_name: tag.name).each { |ti| ti.reject!(User.system) }
TagImplication.active.where(consequent_name: tag.name).each { |ti| ti.reject!(User.system) }
TagImplication.active.where(antecedent_name: tag.name).each { |ti| ti.reject!(User.system) }