app/models/check_list.rb
# not sure why I originally added this.  Doesn't make sense for taxa on non-comprehensive list 
# to be "absent," since they're obviously present if they're on the comprehensive list.
not sure why I originally added this.  Doesn't make sense for taxa on non-comprehensive list
to be "absent," since they're obviously present if they're on the comprehensive list.
not sure why I originally added this . Doesn ' t make sense for taxa on non - comprehensive list to be " absent " since they ' re obviously present if they ' re on the comprehensive list .
def mark_non_comprehensive_listed_taxa_as_absent
    return true unless comprehensive_changed?
    return true unless comprehensive?
    ancestry = [taxon.ancestry, taxon.id].compact.join('/')
    conditions = [
      "place_id = ? AND list_id != ? AND (taxon_ancestor_ids = ? OR taxon_ancestor_ids LIKE ?)", 
      place_id, id, ancestry, "#{ancestry}/%"
    ]
    that = self
    ListedTaxon.do_in_batches(:conditions => conditions) do |lt|
      next if that.listed_taxa.exists?(:taxon_id => lt.taxon_id)
      ListedTaxon.update_all(["occurrence_status_level = ?", ListedTaxon::ABSENT], "id = #{lt.id}")
    end
    true
  end
def mark_non_comprehensive_listed_taxa_as_absent return true unless comprehensive_changed? return true unless comprehensive? ancestry = [ taxon . ancestry , taxon . id ] . compact . join ( '/' ) conditions = [ "place_id = ? AND list_id != ? AND (taxon_ancestor_ids = ? OR taxon_ancestor_ids LIKE ?)" , place_id , id , ancestry , "#{ancestry}/%" ] that = self ListedTaxon . do_in_batches ( :conditions => conditions ) do | lt | next if that . listed_taxa . exists? ( :taxon_id => lt . taxon_id ) ListedTaxon . update_all ( [ "occurrence_status_level = ?" , ListedTaxon :: ABSENT ] , "id = #{lt.id}" ) end true end
not sure why I originally added this.
not sure why I originally added this .