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

17 lines
328 B
Ruby
Raw Normal View History

2020-03-09 13:42:32 +05:30
# 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