debian-mirror-gitlab/app/services/concerns/akismet_methods.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
310 B
Ruby
Raw Normal View History

2020-03-09 13:42:32 +05:30
# frozen_string_literal: true
module AkismetMethods
2020-04-08 14:13:33 +05:30
def target_owner
@user ||= User.find(target.author_id)
2020-03-09 13:42:32 +05:30
end
def akismet
@akismet ||= Spam::AkismetService.new(
2020-04-08 14:13:33 +05:30
target_owner.name,
target_owner.email,
target.try(:spammable_text) || target&.text,
2020-03-09 13:42:32 +05:30
options
)
end
end