Module: CollectionObject::BiologicalExtensions

Extended by:
ActiveSupport::Concern
Included in:
CollectionObject
Defined in:
app/models/collection_object/biological_extensions.rb

Overview

This is all code that properly belongs in CollectionObject::BiologicalCollectionObject, but because inheritance sucks sometimes we include it at the top level

Instance Method Summary collapse

Instance Method Details

#missing_determinationObject

see BiologicalCollectionObject



50
51
# File 'app/models/collection_object/biological_extensions.rb', line 50

def missing_determination
end

#name_at_rank_string(rank) ⇒ String

Ugh: TODO: deprecate! no utility gained here, and it's HTML!!!

Parameters:

  • rank (String)

Returns:

  • (String)

    if a determination exists, and the Otu in the determination has a taxon name then return the taxon name at the rank supplied



56
57
58
# File 'app/models/collection_object/biological_extensions.rb', line 56

def name_at_rank_string(rank)
  current_taxon_name.try(:ancestor_at_rank, rank).try(:cached_html)
end

#reject_otus(attributed) ⇒ Object



65
66
67
68
69
# File 'app/models/collection_object/biological_extensions.rb', line 65

def reject_otus(attributed)
  a = attributed['taxon_name_id']
  b = attributed['name']
  a.blank? && b.blank?
end

#reject_taxon_determinations(attributed) ⇒ Boolean

Returns:

  • (Boolean)


61
62
63
# File 'app/models/collection_object/biological_extensions.rb', line 61

def reject_taxon_determinations(attributed)
  attributed['otu_id'].blank? && attributed[:otu]&.id.blank?
end