fix #2364
This commit is contained in:
@@ -52,14 +52,14 @@ private
|
||||
raise "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.delay(:queue => "default").process!
|
||||
tag_alias.delay(:queue => "default").process!(false)
|
||||
|
||||
when :create_implication
|
||||
tag_implication = TagImplication.create(:forum_topic_id => forum_id, :status => "pending", :antecedent_name => token[1], :consequent_name => token[2])
|
||||
unless tag_implication.valid?
|
||||
raise "Error: #{tag_implication.errors.full_messages.join("; ")} (create implication #{tag_implication.antecedent_name} -> #{tag_implication.consequent_name})"
|
||||
end
|
||||
tag_implication.delay(:queue => "default").process!
|
||||
tag_implication.delay(:queue => "default").process!(false)
|
||||
|
||||
when :remove_alias
|
||||
tag_alias = TagAlias.where("antecedent_name = ?", token[1]).first
|
||||
|
||||
@@ -77,7 +77,7 @@ class TagAlias < ActiveRecord::Base
|
||||
end.uniq
|
||||
end
|
||||
|
||||
def process!
|
||||
def process!(update_topic=true)
|
||||
unless valid?
|
||||
raise errors.full_messages.join("; ")
|
||||
end
|
||||
@@ -86,7 +86,7 @@ class TagAlias < ActiveRecord::Base
|
||||
clear_all_cache
|
||||
ensure_category_consistency
|
||||
update_posts
|
||||
update_forum_topic_for_approve
|
||||
update_forum_topic_for_approve if update_topic
|
||||
update_column(:status, "active")
|
||||
rescue Exception => e
|
||||
update_column(:status, "error: #{e}")
|
||||
|
||||
@@ -120,7 +120,7 @@ class TagImplication < ActiveRecord::Base
|
||||
self.creator_ip_addr = CurrentUser.ip_addr
|
||||
end
|
||||
|
||||
def process!
|
||||
def process!(update_topic=true)
|
||||
unless valid?
|
||||
raise errors.full_messages.join("; ")
|
||||
end
|
||||
@@ -128,7 +128,7 @@ class TagImplication < ActiveRecord::Base
|
||||
update_posts
|
||||
update_column(:status, "active")
|
||||
update_descendant_names_for_parents
|
||||
update_forum_topic_for_approve
|
||||
update_forum_topic_for_approve if update_topic
|
||||
rescue Exception => e
|
||||
update_column(:status, "error: #{e}")
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user