app/models/top_image/rebuilder.rb
# Find all of the parents (all the way up), and calculate the "best" images
# for each, then insert those.
Find all of the parents (all the way up), and calculate the "best" images
for each, then insert those.
Find all of the parents ( all the way up ) and calculate the " best " images for each then insert those .
def bulk_insert_clade_cascades
      EOL.log_call
      all_parent_ids = Set.new
      parent_ids = Set.new
      HierarchyEntry.select("id, parent_id").
        joins("JOIN top_images_tmp ti "\
          "ON (hierarchy_entries.id = ti.hierarchy_entry_id)").
        where("parent_id != 0").find_each do |he|
        parent_ids << he.parent_id
      end
      more_parents = find_best_images_in_clade(parent_ids)
      until(more_parents.blank?)
        all_parent_ids += more_parents
        more_parents = find_best_images_in_clade(parent_ids)
      end
    end
def bulk_insert_clade_cascades EOL . log_call all_parent_ids = Set . new parent_ids = Set . new HierarchyEntry . select ( "id, parent_id" ) . joins ( "JOIN top_images_tmp ti " "ON (hierarchy_entries.id = ti.hierarchy_entry_id)" ) . where ( "parent_id != 0" ) . find_each do | he | parent_ids << he . parent_id end more_parents = find_best_images_in_clade ( parent_ids ) until ( more_parents . blank? ) all_parent_ids += more_parents more_parents = find_best_images_in_clade ( parent_ids ) end end
Find all of the parents (all the way up), and calculate the "best" images
for each, then insert those.
Find all of the parents ( all the way up ) and calculate the " best " images for each then insert those .
# Parents of all the visible leaf nodes with images: