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

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

module AkismetMethods
  def target_owner
    @user ||= User.find(target.author_id)
  end

  def akismet
    @akismet ||= Spam::AkismetService.new(
      target_owner.name,
      target_owner.email,
      target.try(:spammable_text) || target&.text,
      options
    )
  end
end