Class: X509Certificate

Inherits:
ApplicationRecord show all
Includes:
AfterCommitQueue, X509SerialNumberAttribute
Defined in:
app/models/x509_certificate.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from AfterCommitQueue

#run_after_commit, #run_after_commit_or_now

Methods inherited from ApplicationRecord

at_most, id_in, id_not_in, iid_in, pluck_primary_key, primary_key_in, safe_ensure_unique, safe_find_or_create_by, safe_find_or_create_by!, underscore, without_order

Class Method Details

.safe_create!(attributes) ⇒ Object


33
34
35
36
# File 'app/models/x509_certificate.rb', line 33

def self.safe_create!(attributes)
  create_with(attributes)
    .safe_find_or_create_by!(subject_key_identifier: attributes[:subject_key_identifier])
end

.serial_numbers(issuer) ⇒ Object


38
39
40
# File 'app/models/x509_certificate.rb', line 38

def self.serial_numbers(issuer)
  by_x509_issuer(issuer).pluck(:serial_number)
end

Instance Method Details

#mark_commit_signatures_unverifiedObject


42
43
44
# File 'app/models/x509_certificate.rb', line 42

def mark_commit_signatures_unverified
  X509CertificateRevokeWorker.perform_async(self.id) if revoked?
end