diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-20 17:34:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-20 17:34:42 +0300 |
commit | 9f46488805e86b1bc341ea1620b866016c2ce5ed (patch) | |
tree | f9748c7e287041e37d6da49e0a29c9511dc34768 /app/models/x509_certificate.rb | |
parent | dfc92d081ea0332d69c8aca2f0e745cb48ae5e6d (diff) |
Add latest changes from gitlab-org/gitlab@13-0-stable-ee
Diffstat (limited to 'app/models/x509_certificate.rb')
-rw-r--r-- | app/models/x509_certificate.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/x509_certificate.rb b/app/models/x509_certificate.rb index 75b711eab5b..428fd336a32 100644 --- a/app/models/x509_certificate.rb +++ b/app/models/x509_certificate.rb @@ -26,6 +26,8 @@ class X509Certificate < ApplicationRecord validates :x509_issuer_id, presence: true + scope :by_x509_issuer, ->(issuer) { where(x509_issuer_id: issuer.id) } + after_commit :mark_commit_signatures_unverified def self.safe_create!(attributes) @@ -33,6 +35,10 @@ class X509Certificate < ApplicationRecord .safe_find_or_create_by!(subject_key_identifier: attributes[:subject_key_identifier]) end + def self.serial_numbers(issuer) + by_x509_issuer(issuer).pluck(:serial_number) + end + def mark_commit_signatures_unverified X509CertificateRevokeWorker.perform_async(self.id) if revoked? end |