This commit is contained in:
r888888888
2013-04-29 00:28:26 -07:00
parent d1a54f8e23
commit 624058e357
2 changed files with 11 additions and 2 deletions

View File

@@ -25,7 +25,7 @@ class TagImplication < ActiveRecord::Base
until children.empty?
all.concat(children)
children = self.class.where(["antecedent_name IN (?)", children]).all.map(&:consequent_name)
children = TagImplication.where("antecedent_name IN (?) and status = ?", children, "active").all.map(&:consequent_name)
end
end.sort.uniq
end
@@ -40,6 +40,7 @@ class TagImplication < ActiveRecord::Base
end
def update_descendant_names!
clear_descendants_cache
update_descendant_names
update_column(:descendant_names, descendant_names)
end
@@ -104,9 +105,9 @@ class TagImplication < ActiveRecord::Base
def process!
update_column(:status, "processing")
update_descendant_names_for_parent
update_posts
update_column(:status, "active")
update_descendant_names_for_parent
rescue Exception => e
update_column(:status, "error: #{e}")
end