Revert "Fix race condition when auto-moving implications"

This reverts commit 20cceda4e5.
This commit is contained in:
Toks
2014-07-15 11:11:30 -04:00
parent 3c204892a9
commit 4dab3e84f5

View File

@@ -145,14 +145,8 @@ class TagAlias < ActiveRecord::Base
implications.each do |ti|
ti.antecedent_name = self.consequent_name
success = ti.save
if !success
case ti.errors.full_messages.join("; ")
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
if !success && ti.errors.full_messages.join("; ") =~ /Cannot implicate a tag to itself/
ti.destroy
end
end
@@ -160,14 +154,8 @@ class TagAlias < ActiveRecord::Base
implications.each do |ti|
ti.consequent_name = self.consequent_name
success = ti.save
if !success
case ti.errors.full_messages.join("; ")
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
if !success && ti.errors.full_messages.join("; ") =~ /Cannot implicate a tag to itself/
ti.destroy
end
end
end