module Blogspam::Concern

Public Instance Methods

blogspam_args() click to toggle source
# File lib/blogspam/concern.rb, line 12
def blogspam_args
  raise NotImplementedError, "You need to implement `blogspam_args` in your model to pass in the attributes blogspam can use to analyze the comment."
end
check_spam!() click to toggle source
# File lib/blogspam/concern.rb, line 16
def check_spam!
  response = Blogspam.check_spam(blogspam_args)

  if response["result"] == "SPAM"
    update!(is_spam: true, spam_reason: response["reason"])
  end
end