debian-mirror-gitlab/app/services/gpg_keys/create_service.rb
2021-09-30 23:02:18 +05:30

19 lines
337 B
Ruby

# frozen_string_literal: true
module GpgKeys
class CreateService < Keys::BaseService
def execute
key = create(params)
notification_service.new_gpg_key(key) if key.persisted?
key
end
private
def create(params)
user.gpg_keys.create(params)
end
end
end
GpgKeys::CreateService.prepend_mod