debian-mirror-gitlab/app/services/spam/ham_service.rb

29 lines
529 B
Ruby
Raw Normal View History

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