debian-mirror-gitlab/app/services/concerns/akismet_methods.rb
2020-03-09 13:42:32 +05:30

16 lines
328 B
Ruby

# frozen_string_literal: true
module AkismetMethods
def spammable_owner
@user ||= User.find(spammable.author_id)
end
def akismet
@akismet ||= Spam::AkismetService.new(
spammable_owner.name,
spammable_owner.email,
spammable.try(:spammable_text) || spammable&.text,
options
)
end
end