diff options
Diffstat (limited to 'app/services/spam/ham_service.rb')
-rw-r--r-- | app/services/spam/ham_service.rb | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/app/services/spam/ham_service.rb b/app/services/spam/ham_service.rb index cedb9f02f3d..d0f53eea90c 100644 --- a/app/services/spam/ham_service.rb +++ b/app/services/spam/ham_service.rb @@ -4,23 +4,25 @@ module Spam class HamService include AkismetMethods - attr_accessor :target, :options + attr_accessor :spam_log, :options - def initialize(target) - @target = target - @user = target.user + def initialize(spam_log) + @spam_log = spam_log + @user = spam_log.user @options = { - ip_address: target.source_ip, - user_agent: target.user_agent + ip_address: spam_log.source_ip, + user_agent: spam_log.user_agent } end def execute if akismet.submit_ham - target.update_attribute(:submitted_as_ham, true) + spam_log.update_attribute(:submitted_as_ham, true) else false end end + + alias_method :spammable, :spam_log end end |