Tag change notices

This adds a small notice at the bottom of post searches if a single tag search is the target of any tag change request.
This commit is contained in:
Albert Yi
2019-01-14 18:14:27 -08:00
parent 60f0aeeb99
commit 1550538dc1
10 changed files with 143 additions and 0 deletions

View File

@@ -100,6 +100,30 @@ class AliasAndImplicationImporter
end
end
def affected_tags
tokens = self.class.tokenize(text)
tokens.inject([]) do |all, token|
case token[0]
when :create_alias, :remove_alias, :create_implication, :remove_implication
all << token[1]
all << token[2]
all
when :mass_update
all += Tag.scan_tags(token[1])
all += Tag.scan_tags(token[2])
all
when :change_category
all << token[1]
all
else
all
end
end
end
private
def parse(tokens, approver)