blob: 0ebcf17927a1bd86771c9808a45588123414670a (
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
|
# frozen_string_literal: true
module Spam
class MarkAsSpamService
include ::AkismetMethods
attr_accessor :spammable, :options
def initialize(spammable:)
@spammable = spammable
@options = {}
@options[:ip_address] = @spammable.ip_address
@options[:user_agent] = @spammable.user_agent
end
def execute
return unless spammable.submittable_as_spam?
return unless akismet.submit_spam
spammable.user_agent_detail.update_attribute(:submitted, true)
end
end
end
|