aliases/implications: remove forum topic updating code.

Remove code for updating forum topics when an alias or implication is
approved or rejected. This code was only used when approving single
alias or implication requests. This is no longer used now that all
alias/implication requests are done through BURs.
This commit is contained in:
evazion
2020-03-10 20:48:08 -05:00
parent 6504d44223
commit 0e7632ed8a
12 changed files with 20 additions and 202 deletions

View File

@@ -114,24 +114,24 @@ class AliasAndImplicationImporter
raise Error, "Error: #{tag_alias.errors.full_messages.join("; ")} (create alias #{tag_alias.antecedent_name} -> #{tag_alias.consequent_name})"
end
tag_alias.rename_wiki_and_artist if rename_aliased_pages?
tag_alias.approve!(approver: approver, update_topic: false)
tag_alias.approve!(approver: approver)
when :create_implication
tag_implication = TagImplication.create(creator: approver, forum_topic_id: forum_id, status: "pending", antecedent_name: token[1], consequent_name: token[2], skip_secondary_validations: skip_secondary_validations)
unless tag_implication.valid?
raise Error, "Error: #{tag_implication.errors.full_messages.join("; ")} (create implication #{tag_implication.antecedent_name} -> #{tag_implication.consequent_name})"
end
tag_implication.approve!(approver: approver, update_topic: false)
tag_implication.approve!(approver: approver)
when :remove_alias
tag_alias = TagAlias.active.find_by(antecedent_name: token[1], consequent_name: token[2])
raise Error, "Alias for #{token[1]} not found" if tag_alias.nil?
tag_alias.reject!(update_topic: false)
tag_alias.reject!
when :remove_implication
tag_implication = TagImplication.active.find_by(antecedent_name: token[1], consequent_name: token[2])
raise Error, "Implication for #{token[1]} not found" if tag_implication.nil?
tag_implication.reject!(update_topic: false)
tag_implication.reject!
when :mass_update
TagBatchChangeJob.perform_later(token[1], token[2], User.system, "127.0.0.1")

View File

@@ -5,7 +5,6 @@ class ForumUpdater
@forum_topic = forum_topic
@forum_post = options[:forum_post]
@expected_title = options[:expected_title]
@skip_update = options[:skip_update]
end
def update(message, title_tag = nil)
@@ -32,7 +31,6 @@ class ForumUpdater
end
def update_post(body)
return if @skip_update
forum_post.update(body: "#{forum_post.body}\n\nEDIT: #{body}", skip_mention_notifications: true)
end
end

View File

@@ -1,9 +0,0 @@
class TagAliasRequest
def self.command_string(antecedent_name, consequent_name, id = nil)
if id
return "[ta:#{id}]"
end
"create alias [[#{antecedent_name}]] -> [[#{consequent_name}]]"
end
end

View File

@@ -1,9 +0,0 @@
class TagImplicationRequest
def self.command_string(antecedent_name, consequent_name, id = nil)
if id
return "[ti:#{id}]"
end
"create implication [[#{antecedent_name}]] -> [[#{consequent_name}]]"
end
end