Class: Repositories::Tags::GpgSignature

Inherits:
ApplicationRecord show all
Includes:
BulkInsertSafe, ShaAttribute, SignatureType
Defined in:
app/models/repositories/tags/gpg_signature.rb

Constant Summary

Constants included from BulkInsertSafe

BulkInsertSafe::ALLOWED_CALLBACKS, BulkInsertSafe::DEFAULT_BATCH_SIZE, BulkInsertSafe::MethodNotAllowedError, BulkInsertSafe::PrimaryKeySetError

Constants included from SignatureType

SignatureType::TYPES

Constants inherited from ApplicationRecord

ApplicationRecord::MAX_PLUCK

Constants included from HasCheckConstraints

HasCheckConstraints::NOT_NULL_CHECK_PATTERN

Constants included from ResetOnColumnErrors

ResetOnColumnErrors::MAX_RESET_PERIOD

Instance Method Summary collapse

Methods inherited from ApplicationRecord

===, cached_column_list, #create_or_load_association, current_transaction, declarative_enum, default_select_columns, delete_all_returning, #deleted_from_database?, id_in, id_not_in, iid_in, nullable_column?, primary_key_in, #readable_by?, safe_ensure_unique, safe_find_or_create_by, safe_find_or_create_by!, #to_ability_name, underscore, where_exists, where_not_exists, with_fast_read_statement_timeout, without_order

Methods included from Organizations::Sharding

#sharding_organization

Methods included from ResetOnColumnErrors

#reset_on_union_error, #reset_on_unknown_attribute_error

Methods included from Gitlab::SensitiveSerializableHash

#serializable_hash

Instance Method Details

#gpg_keyObject



30
31
32
33
34
35
36
# File 'app/models/repositories/tags/gpg_signature.rb', line 30

def gpg_key
  if gpg_key_id
    super
  elsif gpg_key_subkey_id
    gpg_key_subkey
  end
end

#gpg_key=(model) ⇒ Object



38
39
40
41
42
43
44
45
46
47
48
# File 'app/models/repositories/tags/gpg_signature.rb', line 38

def gpg_key=(model)
  case model
  when GpgKey
    super
  when GpgKeySubkey
    self.gpg_key_subkey = model
  when NilClass
    super
    self.gpg_key_subkey = nil
  end
end

#typeObject



26
27
28
# File 'app/models/repositories/tags/gpg_signature.rb', line 26

def type
  :gpg
end