Class: TaxonNameRelationship

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
Housekeeping, Shared::Citable, SoftValidation
Defined in:
app/models/taxon_name_relationship.rb

Defined Under Namespace

Classes: Combination, Icn, Iczn, OriginalCombination, SourceClassifiedAs, Typification

Class Method Summary collapse

Instance Method Summary collapse

Methods included from SoftValidation

#clear_soft_validations, #fix_soft_validations, #soft_fixed?, #soft_valid?, #soft_validate, #soft_validated?, #soft_validations

Methods included from Housekeeping

#has_polymorphic_relationship?

Class Method Details

.assignableObject



96
97
98
# File 'app/models/taxon_name_relationship.rb', line 96

def self.assignable
  false
end

.disjoint_object_classesObject



92
93
94
# File 'app/models/taxon_name_relationship.rb', line 92

def self.disjoint_object_classes
  []
end

.disjoint_subject_classesObject



88
89
90
# File 'app/models/taxon_name_relationship.rb', line 88

def self.disjoint_subject_classes
  []
end

.disjoint_taxon_name_relationshipsObject

disjoint relationships for the taxon as a subject



79
80
81
# File 'app/models/taxon_name_relationship.rb', line 79

def self.disjoint_taxon_name_relationships
  []
end

.nomenclatural_priorityObject



100
101
102
# File 'app/models/taxon_name_relationship.rb', line 100

def self.nomenclatural_priority
  nil # :direct - for subject is younger than object; :reverse - for object is younger than subject
end

.object_relationship_nameObject



108
109
110
# File 'app/models/taxon_name_relationship.rb', line 108

def self.object_relationship_name
  self.name.demodulize.underscore.humanize.downcase
end

.required_taxon_name_relationshipsObject

disjoint relationships for the taxon as a object



84
85
86
# File 'app/models/taxon_name_relationship.rb', line 84

def self.required_taxon_name_relationships
  []
end

.subject_relationship_nameObject



104
105
106
# File 'app/models/taxon_name_relationship.rb', line 104

def self.subject_relationship_name
  self.name.demodulize.underscore.humanize.downcase
end

.valid_object_ranksObject

right_side



74
75
76
# File 'app/models/taxon_name_relationship.rb', line 74

def self.valid_object_ranks
  []
end

.valid_subject_ranksObject

left side



69
70
71
# File 'app/models/taxon_name_relationship.rb', line 69

def self.valid_subject_ranks
  []
end

Instance Method Details

#aliasesObject



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

def aliases
  []
end

#is_combination?Boolean

Returns:

  • (Boolean)


52
53
54
# File 'app/models/taxon_name_relationship.rb', line 52

def is_combination?
  !!/TaxonNameRelationship::(OriginalCombination|Combination|SourceClassifiedAs)/.match(self.type.to_s)
end

#object_propertiesObject



60
61
62
# File 'app/models/taxon_name_relationship.rb', line 60

def object_properties
  []
end

#subject_propertiesObject



64
65
66
# File 'app/models/taxon_name_relationship.rb', line 64

def subject_properties
  []
end

#type_classObject



121
122
123
124
125
# File 'app/models/taxon_name_relationship.rb', line 121

def type_class
  r = read_attribute(:type).to_s
  r = TAXON_NAME_RELATIONSHIP_NAMES.include?(r) ? r.safe_constantize : r
  r
end

#type_class=(value) ⇒ Object



117
118
119
# File 'app/models/taxon_name_relationship.rb', line 117

def type_class=(value)
  write_attribute(:type, value.to_s)
end

#type_nameObject



112
113
114
115
# File 'app/models/taxon_name_relationship.rb', line 112

def type_name
  r = self.type.to_s
  TAXON_NAME_RELATIONSHIP_NAMES.include?(r) ? r : nil
end