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

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

module Users
  class AllowPossibleSpamService < BaseService
    def initialize(current_user)
      @current_user = current_user
    end

    def execute(user)
      custom_attribute = {
        user_id: user.id,
        key: UserCustomAttribute::ALLOW_POSSIBLE_SPAM,
        value: "#{current_user.username}/#{current_user.id}+#{Time.current}"
      }
      UserCustomAttribute.upsert_custom_attributes([custom_attribute])
    end
  end
end