Class: RailsBlogEngine::Comment

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
Rakismet::Model
Defined in:
app/models/rails_blog_engine/comment.rb

Instance Method Summary collapse

Instance Method Details

#run_spam_filterObject

Run the spam filter on this comment and update it appropriately.



55
56
57
58
59
60
61
62
# File 'app/models/rails_blog_engine/comment.rb', line 55

def run_spam_filter
  return unless Rakismet.key
  if spam?
    filter_as_spam!
  else
    filter_as_ham!
  end
end

#train_as_hamObject

Train our spam filter to treat messages like this as ham.



65
66
67
# File 'app/models/rails_blog_engine/comment.rb', line 65

def train_as_ham
  ham! if Rakismet.key
end

#train_as_spamObject

Train our spam filter to treat messages like this as spam.



70
71
72
# File 'app/models/rails_blog_engine/comment.rb', line 70

def train_as_spam
  spam! if Rakismet.key
end