Welcome to mirror list, hosted at ThFree Co, Russian Federation.

create_service.rb « emails « services « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 473256d9c6feee83833465b3e3117ddf4d892c9c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

module Emails
  class CreateService < ::Emails::BaseService
    def execute(extra_params = {})
      skip_confirmation = params.delete(:skip_confirmation)

      user.emails.create(params.merge(extra_params)).tap do |email|
        email&.confirm if skip_confirmation && current_user.admin?
      end
    end
  end
end

Emails::CreateService.prepend_if_ee('EE::Emails::CreateService')