fixes #2378
This commit is contained in:
@@ -198,11 +198,15 @@ class TagAlias < ActiveRecord::Base
|
||||
|
||||
def rename_wiki_and_artist
|
||||
antecedent_wiki = WikiPage.titled(antecedent_name).first
|
||||
if antecedent_wiki.present? && WikiPage.titled(consequent_name).blank?
|
||||
CurrentUser.scoped(creator, creator_ip_addr) do
|
||||
antecedent_wiki.update_attributes(
|
||||
:title => consequent_name
|
||||
)
|
||||
if antecedent_wiki.present?
|
||||
if WikiPage.titled(consequent_name).blank?
|
||||
CurrentUser.scoped(creator, creator_ip_addr) do
|
||||
antecedent_wiki.update_attributes(
|
||||
:title => consequent_name
|
||||
)
|
||||
end
|
||||
else
|
||||
update_forum_topic_for_wiki_conflict
|
||||
end
|
||||
end
|
||||
|
||||
@@ -249,6 +253,16 @@ class TagAlias < ActiveRecord::Base
|
||||
end
|
||||
end
|
||||
|
||||
def update_forum_topic_for_wiki_conflict
|
||||
if forum_topic
|
||||
CurrentUser.scoped(User.admins.first, "127.0.0.1") do
|
||||
forum_topic.posts.create(
|
||||
:body => "The tag alias [[#{antecedent_name}]] -> [[#{consequent_name}]] has conflicting wiki pages. [[#{consequent_name}]] should be updated to include information from [[#{antecedent_name}]] if necessary."
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def reject!
|
||||
update_column(:status, "deleted")
|
||||
clear_all_cache
|
||||
|
||||
Reference in New Issue
Block a user