blob: b4f146e564725cc5814c441099589d4743b45c12 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
class GpgKeySubkey < ActiveRecord::Base
include ShaAttribute
sha_attribute :keyid
sha_attribute :fingerprint
belongs_to :gpg_key
validates :gpg_key_id, presence: true
validates :fingerprint, :keyid, presence: true, uniqueness: true
def keyid
super&.upcase
end
def fingerprint
super&.upcase
end
def method_missing(m, *a, &b)
return super unless gpg_key.respond_to?(m)
gpg_key.public_send(m, *a, &b) # rubocop:disable GitlabSecurity/PublicSend
end
def respond_to_missing?(method, include_private = false)
gpg_key.respond_to?(method, include_private) || super
end
end
|