allow removal of gpg key by nullifying signatures

This commit is contained in:
Alexis Reigel 2017-06-22 17:21:03 +02:00
parent 9816856d05
commit 2ea951454a
1 changed files with 1 additions and 0 deletions

View File

@ -4,6 +4,7 @@ class GpgKey < ActiveRecord::Base
KEY_PREFIX = '-----BEGIN PGP PUBLIC KEY BLOCK-----'.freeze
belongs_to :user
has_many :gpg_signatures, dependent: :nullify
validates :key,
presence: true,