Revert "Fix race condition when auto-moving implications"
This reverts commit 20cceda4e5.
This commit is contained in:
@@ -145,14 +145,8 @@ class TagAlias < ActiveRecord::Base
|
|||||||
implications.each do |ti|
|
implications.each do |ti|
|
||||||
ti.antecedent_name = self.consequent_name
|
ti.antecedent_name = self.consequent_name
|
||||||
success = ti.save
|
success = ti.save
|
||||||
if !success
|
if !success && ti.errors.full_messages.join("; ") =~ /Cannot implicate a tag to itself/
|
||||||
case ti.errors.full_messages.join("; ")
|
ti.destroy
|
||||||
when /Cannot implicate a tag to itself/
|
|
||||||
ti.destroy
|
|
||||||
when /Consequent tag must not be aliased to another tag/
|
|
||||||
ti.consequent_name = TagAlias.to_aliased(ti.consequent_name).first
|
|
||||||
ti.save
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -160,14 +154,8 @@ class TagAlias < ActiveRecord::Base
|
|||||||
implications.each do |ti|
|
implications.each do |ti|
|
||||||
ti.consequent_name = self.consequent_name
|
ti.consequent_name = self.consequent_name
|
||||||
success = ti.save
|
success = ti.save
|
||||||
if !success
|
if !success && ti.errors.full_messages.join("; ") =~ /Cannot implicate a tag to itself/
|
||||||
case ti.errors.full_messages.join("; ")
|
ti.destroy
|
||||||
when /Cannot implicate a tag to itself/
|
|
||||||
ti.destroy
|
|
||||||
when /Antecedent tag must not be aliased to another tag/
|
|
||||||
ti.antecedent_name = TagAlias.to_aliased(ti.antecedent_name).first
|
|
||||||
ti.save
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user