Module: Shared::BiologicalExtensions

Extended by:
ActiveSupport::Concern
Included in:
CollectionObject, FieldOccurrence
Defined in:
app/models/concerns/shared/biological_extensions.rb

Overview

Shared code that references things with TaxonDeterminations and Biocuration classes

Current FieldOccurence
        CollectionObject (should be CollectionObject::BiologicalCollectionObject)

Instance Method Summary collapse

Instance Method Details

#missing_determinationObject

see BiologicalCollectionObject



73
74
# File 'app/models/concerns/shared/biological_extensions.rb', line 73

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



83
84
85
# File 'app/models/concerns/shared/biological_extensions.rb', line 83

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

#reject_otus(attributed) ⇒ Object



92
93
94
95
96
# File 'app/models/concerns/shared/biological_extensions.rb', line 92

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

#reject_taxon_determinations(attributed) ⇒ Boolean

Returns:

  • (Boolean)


88
89
90
# File 'app/models/concerns/shared/biological_extensions.rb', line 88

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

#requires_taxon_determination?Boolean

Returns:

  • (Boolean)


76
77
78
# File 'app/models/concerns/shared/biological_extensions.rb', line 76

def requires_taxon_determination?
  false
end