Class: Identifier::Global::Uri::Grscicoll

Inherits:
Identifier::Global::Uri show all
Defined in:
app/models/identifier/global/uri/grscicoll.rb

Overview

Constant Summary collapse

VALID_ROOTS =
%w{
  http://grscicoll.org
  http://grbio.org
  http://biocol.org
}

Constants included from SoftValidation

SoftValidation::ANCESTORS_WITH_SOFT_VALIDATIONS

Instance Attribute Summary

Attributes inherited from Identifier::Global

#relation

Attributes inherited from Identifier

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

Attributes included from Shared::DualAnnotator

#is_community_annotation

Instance Method Summary collapse

Methods inherited from Identifier::Global::Uri

#using_uri_class

Methods inherited from Identifier::Global

#build_cached, #is_global?, #permit_only_one_global_without_relation_supplied_per_type, #set_cached, #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

#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::DualAnnotator

#is_community_annotation?

Methods inherited from ApplicationRecord

transaction_with_retry

Instance Method Details

#references_a_known_formObject (protected)



15
16
17
# File 'app/models/identifier/global/uri/grscicoll.rb', line 15

def references_a_known_form
  errors.add(:identifier, 'Does not appear to contain grscicoll.org or grbio.org.') if !(identifier =~ /^#{VALID_ROOTS.join('|')}/)
end

#used_on_repositoryObject (protected)



19
20
21
# File 'app/models/identifier/global/uri/grscicoll.rb', line 19

def used_on_repository
  errors.add(:identifier_object_type, 'Grscicoll identifiers May only be used on Repositories') if identifier_object_type != 'Repository'
end