Class: TaxonNameRelationship::Icn

Inherits:
TaxonNameRelationship
  • Object
show all
Defined in:
app/models/taxon_name_relationship/icn.rb

Direct Known Subclasses

Accepting, Unaccepting

Defined Under Namespace

Classes: Accepting, Unaccepting

Constant Summary collapse

NOMEN_URI =
'http://purl.obolibrary.org/obo/NOMEN_0000232'.freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.disjoint_object_classesObject



21
22
23
24
25
26
# File 'app/models/taxon_name_relationship/icn.rb', line 21

def self.disjoint_object_classes
  ICZN_TAXON_NAME_CLASSIFICATION_NAMES + ICNP_TAXON_NAME_CLASSIFICATION_NAMES +
      self.collect_descendants_and_itself_to_s(TaxonNameClassification::Icn::NotEffectivelyPublished,
          TaxonNameClassification::Icn::EffectivelyPublished::InvalidlyPublished,
          TaxonNameClassification::Icn::EffectivelyPublished::ValidlyPublished::Illegitimate)
end

.disjoint_subject_classesObject



17
18
19
# File 'app/models/taxon_name_relationship/icn.rb', line 17

def self.disjoint_subject_classes
  ICZN_TAXON_NAME_CLASSIFICATION_NAMES + ICNP_TAXON_NAME_CLASSIFICATION_NAMES + ICVCN_TAXON_NAME_CLASSIFICATION_NAMES
end

.valid_object_ranksObject

right_side



13
14
15
# File 'app/models/taxon_name_relationship/icn.rb', line 13

def self.valid_object_ranks
  ::ICN
end

.valid_subject_ranksObject

left_side



8
9
10
# File 'app/models/taxon_name_relationship/icn.rb', line 8

def self.valid_subject_ranks
  ::ICN
end

Instance Method Details

#sv_validate_priorityObject



28
29
30
31
32
33
34
35
36
37
38
# File 'app/models/taxon_name_relationship/icn.rb', line 28

def sv_validate_priority
  if self.type_class.nomenclatural_priority == :direct
    date1 = self.subject_taxon_name.cached_nomenclature_date
    date2 = self.object_taxon_name.cached_nomenclature_date
    if !!date1 && !!date2 && subject_invalid_statuses.empty?
      if TaxonNameRelationship.where_subject_is_taxon_name(self.subject_taxon_name).with_two_type_bases('TaxonNameRelationship::Icn::Accepting::Conserved', 'TaxonNameRelationship::Icn::Accepting::Sanctioned').not_self(self).empty?
        soft_validations.add(:type, "#{self.subject_status.capitalize} #{self.subject_taxon_name.cached_html_name_and_author_year} should not be older than #{self.object_status} #{self.object_taxon_name.cached_html_name_and_author_year}, unless it is also conserved or sanctioned name")
      end
    end
  end
end