Class: Identifier::Global::Uuid::Auto

Inherits:
Identifier::Global::Uuid show all
Defined in:
app/models/identifier/global/uuid/auto.rb

Overview

A generic auto-added Uuuid by taxonworks. Not necessarily in the DwC generation process, but likely replacing those in the generation process.

Constant Summary

Constants included from SoftValidation

SoftValidation::ANCESTORS_WITH_SOFT_VALIDATIONS

Constants included from Shared::DualAnnotator

Shared::DualAnnotator::ALWAYS_COMMUNITY

Instance Attribute Summary

Attributes inherited from Identifier::Global::Uuid

#is_generated

Attributes inherited from Identifier::Global

#relation

Attributes inherited from Identifier

#cached, #cached_numeric_identifier, #identifier, #identifier_object_id, #namespace_id, #project_id, #type

Instance Method Summary collapse

Methods inherited from Identifier::Global::Uuid

#generate_uuid, #using_uuid_class

Methods inherited from Identifier::Global

#build_cached, #is_global?, #permit_only_one_global_without_relation_supplied_per_type, #sv_resolves?

Methods included from SoftValidation

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

Methods inherited from Identifier

#build_cached, #build_cached_numeric_identifier, #is_global?, #is_local?, prototype_identifier, #set_cached, #type_name

Methods included from Shared::IsData

#errors_excepting, #full_error_messages_excepting, #identical, #is_community?, #is_destroyable?, #is_editable?, #is_in_use?, #is_in_users_projects?, #metamorphosize, #similar

Methods included from Shared::Labels

#labeled?

Methods included from Housekeeping

#has_polymorphic_relationship?

Methods included from Shared::PolymorphicAnnotator

#annotated_object_is_persisted?

Methods inherited from ApplicationRecord

transaction_with_retry

Instance Method Details

#no_other_uuidsObject



7
8
9
10
11
# File 'app/models/identifier/global/uuid/auto.rb', line 7

def no_other_uuids
  if identifier_object.persisted?
    errors.add(:identifier_object, 'UUID alread exists on this object') if ::Identifier::Global::Uuid.where(identifier_object:).any?
  end
end