blob: 87069d5cd54d44564a4d4ac9d4a9b3d4f23eea17 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# frozen_string_literal: true
module Spam
class HamService
include AkismetMethods
attr_accessor :spam_log, :options
def initialize(spam_log)
@spam_log = spam_log
@user = spam_log.user
@options = {
ip_address: spam_log.source_ip,
user_agent: spam_log.user_agent
}
end
def execute
if akismet.submit_ham
spam_log.update_attribute(:submitted_as_ham, true)
else
false
end
end
alias_method :target, :spam_log
end
end
|