Class: TypeMaterial

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

Constant Summary

ICZN_TYPES =

Keys are valid values for type_type, values are required Class for material

{
  'holotype' =>  Specimen,
  'paratype' => Specimen,
  'paralectotype' => Specimen,
  'neotype' => Specimen,
  'lectotype' => Specimen,
  'syntype' => Specimen,
  'paratypes' => Lot,
  'syntypes' => Lot,
  'paralectotypes' => Lot
}
ICN_TYPES =
{
    'holotype' => Specimen,
    'paratype' => Specimen,
    'lectotype' => Specimen,
    'neotype' => Specimen,
    'epitype' => Specimen,
    'isotype' => Specimen,
    'syntype' => Specimen,
    'isosyntype' => Specimen,
    'syntypes' => Lot,
    'isotypes' => Lot,
    'isosyntypes' => Lot
}

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?

Instance Method Details

#type_sourceObject



60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'app/models/type_material.rb', line 60

def type_source
  if !!self.source_id
    self.source
  elsif !!self.protonym
    if !!self.protonym.source_id
      self.protonym.source
    else
      nil
    end
  else
    nil
  end
end