diff options
author | Rubén Dávila <ruben@gitlab.com> | 2017-10-05 02:44:49 +0300 |
---|---|---|
committer | Rubén Dávila <ruben@gitlab.com> | 2017-10-05 16:26:02 +0300 |
commit | dd139e65b53f30eae2d8bb50dff180e8eab11fe4 (patch) | |
tree | 32411533b4ccfdfb6a2f08e2df0f2bb2b383e61d /app/models/gpg_key.rb | |
parent | 2577cc99818bd0332aa78018de666579971341c8 (diff) |
Invalidate GpgSignatures associated to GpgKeySubkeys when revoking the GpgKey
Diffstat (limited to 'app/models/gpg_key.rb')
-rw-r--r-- | app/models/gpg_key.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/gpg_key.rb b/app/models/gpg_key.rb index 145b957fc88..44eda741679 100644 --- a/app/models/gpg_key.rb +++ b/app/models/gpg_key.rb @@ -91,10 +91,11 @@ class GpgKey < ActiveRecord::Base def revoke GpgSignature - .where(gpg_key: self) + .with_key_and_subkeys(self) .where.not(verification_status: GpgSignature.verification_statuses[:unknown_key]) .update_all( gpg_key_id: nil, + gpg_key_subkey_id: nil, verification_status: GpgSignature.verification_statuses[:unknown_key], updated_at: Time.zone.now ) |