potential fix for #1800

This commit is contained in:
r888888888
2013-07-31 16:56:32 -07:00
parent 51e656d61e
commit 33f8ad000c
2 changed files with 20 additions and 16 deletions

View File

@@ -127,6 +127,7 @@ class TagAlias < ActiveRecord::Base
def update_posts
CurrentUser.without_safe_mode do
Post.without_timeout do
Post.raw_tag_match(antecedent_name).find_each do |post|
escaped_antecedent_name = Regexp.escape(antecedent_name)
fixed_tags = post.tag_string.sub(/(?:\A| )#{escaped_antecedent_name}(?:\Z| )/, " #{consequent_name} ").strip
@@ -141,6 +142,7 @@ class TagAlias < ActiveRecord::Base
consequent_tag.fix_post_count if consequent_tag
end
end
end
def rename_wiki_and_artist
antecedent_wiki = WikiPage.titled(antecedent_name).first

View File

@@ -127,6 +127,7 @@ class TagImplication < ActiveRecord::Base
def update_posts
CurrentUser.without_safe_mode do
Post.without_timeout do
Post.raw_tag_match(antecedent_name).find_each do |post|
fixed_tags = "#{post.tag_string} #{descendant_names}".strip
CurrentUser.scoped(creator, creator_ip_addr) do
@@ -137,6 +138,7 @@ class TagImplication < ActiveRecord::Base
end
end
end
end
def normalize_names
self.antecedent_name = antecedent_name.downcase.tr(" ", "_")