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
|