app/models/dataset_record/darwin_core/taxon.rb
# Check if all dependencies of a taxonID are imported
Check if all dependencies of a taxonID are imported
Check if all dependencies of a taxonID are imported
def dependencies_imported?(taxon_id)
    dependency_taxon_ids = DatasetRecord::DarwinCore::Taxon.where(id: import_dataset.core_records_fields
                                                                                    .at(get_field_mapping(:taxonID))
                                                                                    .with_value(taxon_id.to_s)
                                                                                    .select(:dataset_record_id)
    ).pick(:metadata)['dependencies']
    DatasetRecord::DarwinCore::Taxon.where(id: import_dataset.core_records_fields
                                                             .at(get_field_mapping(:taxonID))
                                                             .with_values(dependency_taxon_ids.map { |d| d.to_s })
                                                             .select(:dataset_record_id)
    ).where(status: 'Imported').count == dependency_taxon_ids.length
  end
def dependencies_imported? ( taxon_id ) dependency_taxon_ids = DatasetRecord :: DarwinCore :: Taxon . where ( id : import_dataset . core_records_fields . at ( get_field_mapping ( :taxonID ) ) . with_value ( taxon_id . to_s ) . select ( :dataset_record_id ) ) . pick ( :metadata ) [ 'dependencies' ] DatasetRecord :: DarwinCore :: Taxon . where ( id : import_dataset . core_records_fields . at ( get_field_mapping ( :taxonID ) ) . with_values ( dependency_taxon_ids . map { | d | d . to_s } ) . select ( :dataset_record_id ) ) . where ( status : 'Imported' ) . count == dependency_taxon_ids . length end
Check if all dependencies of a taxonID are imported
Check if all dependencies of a taxonID are imported
taxon_id
<not_specific>