Class: RailsBlogEngine::Comment
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- RailsBlogEngine::Comment
- Includes:
- Rakismet::Model
- Defined in:
- app/models/rails_blog_engine/comment.rb
Instance Method Summary collapse
-
#run_spam_filter ⇒ Object
Run the spam filter on this comment and update it appropriately.
-
#train_as_ham ⇒ Object
Train our spam filter to treat messages like this as ham.
-
#train_as_spam ⇒ Object
Train our spam filter to treat messages like this as spam.
Instance Method Details
#run_spam_filter ⇒ Object
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_ham ⇒ Object
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_spam ⇒ Object
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 |