Module: Shared::BiologicalExtensions
- Extended by:
- ActiveSupport::Concern
- Included in:
- CollectionObject, FieldOccurrence
- Defined in:
- app/models/concerns/shared/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
-
#missing_determination ⇒ Object
see BiologicalCollectionObject.
-
#name_at_rank_string(rank) ⇒ String
Ugh: TODO: deprecate! no utility gained here, and it’s HTML!!!.
- #reject_otus(attributed) ⇒ Object
- #reject_taxon_determinations(attributed) ⇒ Boolean
- #requires_taxon_determination? ⇒ Boolean
Instance Method Details
#missing_determination ⇒ Object
see BiologicalCollectionObject
76 77 |
# File 'app/models/concerns/shared/biological_extensions.rb', line 76 def missing_determination end |
#name_at_rank_string(rank) ⇒ String
Ugh: TODO: deprecate! no utility gained here, and it’s HTML!!!
86 87 88 |
# File 'app/models/concerns/shared/biological_extensions.rb', line 86 def name_at_rank_string(rank) current_taxon_name.try(:ancestor_at_rank, rank).try(:cached_html) end |
#reject_otus(attributed) ⇒ Object
95 96 97 98 99 |
# File 'app/models/concerns/shared/biological_extensions.rb', line 95 def reject_otus(attributed) a = attributed['taxon_name_id'] b = attributed['name'] a.blank? && b.blank? end |
#reject_taxon_determinations(attributed) ⇒ Boolean
91 92 93 |
# File 'app/models/concerns/shared/biological_extensions.rb', line 91 def reject_taxon_determinations(attributed) attributed['otu_id'].blank? && attributed[:otu]&.id.blank? end |
#requires_taxon_determination? ⇒ Boolean
79 80 81 |
# File 'app/models/concerns/shared/biological_extensions.rb', line 79 def requires_taxon_determination? false end |