Class: Identifier::Unknown

Inherits:
Identifier show all
Defined in:
app/models/identifier/unknown.rb

Overview

The identifier whose origin and scope is unknown (i.e. can not be deduced after effort).

Instantiating this class asserts that a namespace can not be determined.

Constant Summary

Constants included from Shared::DualAnnotator

Shared::DualAnnotator::ALWAYS_COMMUNITY

Instance Attribute Summary collapse

Attributes inherited from Identifier

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

Instance Method Summary collapse

Methods inherited from Identifier

#build_cached, #build_cached_numeric_identifier, #is_global?, #is_local?, prototype_identifier, #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 Attribute Details

#identifierString

The verbatim value of this identifier.

Returns:

  • (String)


8
9
10
11
12
13
14
15
16
17
# File 'app/models/identifier/unknown.rb', line 8

class Identifier::Unknown < Identifier

  validates_uniqueness_of :identifier, scope: [:project_id]

  protected

  def set_cached
    update_column(:cached, identifier)
  end
end

Instance Method Details

#set_cachedObject (protected)



14
15
16
# File 'app/models/identifier/unknown.rb', line 14

def set_cached
  update_column(:cached, identifier)
end