diff options
author | Alexis Reigel <mail@koffeinfrei.org> | 2017-07-05 14:23:23 +0200 |
---|---|---|
committer | Alexis Reigel <mail@koffeinfrei.org> | 2017-07-27 15:43:37 +0200 |
commit | 084cc718f759a37c8fc5535930daeee5e819c30f (patch) | |
tree | 18303c29284db67b54e29139431663dd0cebe7e7 /app/models/gpg_key.rb | |
parent | e79e2ae1f4b671488b31428f7a6506a245a7bddc (diff) | |
download | gitlab-ce-084cc718f759a37c8fc5535930daeee5e819c30f.tar.gz |
use after_commit instead of AfterCommitQueue
Diffstat (limited to 'app/models/gpg_key.rb')
-rw-r--r-- | app/models/gpg_key.rb | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/app/models/gpg_key.rb b/app/models/gpg_key.rb index 612d954b1c5..050245bd502 100644 --- a/app/models/gpg_key.rb +++ b/app/models/gpg_key.rb @@ -1,6 +1,4 @@ class GpgKey < ActiveRecord::Base - include AfterCommitQueue - KEY_PREFIX = '-----BEGIN PGP PUBLIC KEY BLOCK-----'.freeze belongs_to :user @@ -31,8 +29,8 @@ class GpgKey < ActiveRecord::Base unless: -> { errors.has_key?(:key) } before_validation :extract_fingerprint, :extract_primary_keyid - after_create :update_invalid_gpg_signatures_after_create - after_create :notify_user + after_commit :update_invalid_gpg_signatures, on: :create + after_commit :notify_user, on: :create def key=(value) value.strip! unless value.blank? @@ -75,10 +73,6 @@ class GpgKey < ActiveRecord::Base end def notify_user - run_after_commit { NotificationService.new.new_gpg_key(self) } - end - - def update_invalid_gpg_signatures_after_create - run_after_commit { update_invalid_gpg_signatures } + NotificationService.new.new_gpg_key(self) end end |