Class: TaxonNameRelationship::Icnp::Accepting::ConservedName

Inherits:
TaxonNameRelationship::Icnp::Accepting show all
Defined in:
app/models/taxon_name_relationship/icnp/accepting/conserved_name.rb

Constant Summary collapse

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

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from TaxonNameRelationship::Icnp::Accepting

disjoint_subject_classes, disjoint_taxon_name_relationships, #subject_properties

Methods inherited from TaxonNameRelationship::Icnp

disjoint_object_classes, disjoint_subject_classes, valid_object_ranks, valid_subject_ranks

Class Method Details

.assignableObject



5
6
7
# File 'app/models/taxon_name_relationship/icnp/accepting/conserved_name.rb', line 5

def self.assignable
  true
end

.assignment_methodObject



29
30
31
32
# File 'app/models/taxon_name_relationship/icnp/accepting/conserved_name.rb', line 29

def self.assignment_method
  # bus.set_as_icn_conserved_name_of(aus)
  :icnp_set_as_conserved_name_of
end

.gbif_status_of_objectObject



21
22
23
# File 'app/models/taxon_name_relationship/icnp/accepting/conserved_name.rb', line 21

def self.gbif_status_of_object
  'rejiciendum'
end

.gbif_status_of_subjectObject



17
18
19
# File 'app/models/taxon_name_relationship/icnp/accepting/conserved_name.rb', line 17

def self.gbif_status_of_subject
  'conservandum'
end

.inverse_assignment_methodObject



34
35
36
37
# File 'app/models/taxon_name_relationship/icnp/accepting/conserved_name.rb', line 34

def self.inverse_assignment_method
  # aus.icn_conserved_name = bus
  :icnp_conserved_name
end

.nomenclatural_priorityObject



25
26
27
# File 'app/models/taxon_name_relationship/icnp/accepting/conserved_name.rb', line 25

def self.nomenclatural_priority
  :reverse
end

Instance Method Details

#object_statusObject



9
10
11
# File 'app/models/taxon_name_relationship/icnp/accepting/conserved_name.rb', line 9

def object_status
  'rejected'
end

#subject_statusObject



13
14
15
# File 'app/models/taxon_name_relationship/icnp/accepting/conserved_name.rb', line 13

def subject_status
  'conserved'
end

#sv_validate_priorityObject



39
40
41
42
43
44
45
# File 'app/models/taxon_name_relationship/icnp/accepting/conserved_name.rb', line 39

def sv_validate_priority
  date1 = self.subject_taxon_name.cached_nomenclature_date
  date2 = self.object_taxon_name.cached_nomenclature_date
  if !!date1 && !!date2 && date1 > date2 && subject_invalid_statuses.empty?
    soft_validations.add(:type, "#{self.subject_status.capitalize} #{self.subject_taxon_name.cached_html_name_and_author_year} should not be younger than #{self.object_taxon_name.cached_html_name_and_author_year}")
  end
end