Class: DatasetRecord::DarwinCore::Occurrence::ImportProtonym::CreateIfNotExists
- Inherits:
-
ImportProtonym
- Object
- ImportProtonym
- DatasetRecord::DarwinCore::Occurrence::ImportProtonym::CreateIfNotExists
- Defined in:
- app/models/dataset_record/darwin_core/occurrence.rb
Instance Method Summary collapse
Instance Method Details
#exception_args(origins, parent, name, protonym) ⇒ Object
201 202 203 204 205 206 207 |
# File 'app/models/dataset_record/darwin_core/occurrence.rb', line 201 def exception_args(origins, parent, name, protonym) { origins[name.object_id] => name[:rank_class].present? ? protonym.errors..values.flatten : ["Rank for #{name[:name]} could not be determined. Please create this taxon name manually and retry."] } end |
#get_protonym(parent, name) ⇒ Object
197 198 199 |
# File 'app/models/dataset_record/darwin_core/occurrence.rb', line 197 def get_protonym(parent, name) super || Protonym.create({parent:, also_create_otu: true}.merge!(name)) end |