From 14699f4b6abc4b85b0f0b3c2cfdaf0125d2b222e Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Sun, 26 Aug 2012 19:43:57 -0300 Subject: [PATCH] Extract Method --- app/models/comment.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/comment.rb b/app/models/comment.rb index 6667f00..6bb9bec 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -100,12 +100,16 @@ class Comment < ActiveRecord::Base include Noosfero::Plugin::HotSpot def verify_and_notify - plugins.dispatch(:check_comment_for_spam, self) + check_for_spam unless spam? notify_by_mail end end + def check_for_spam + plugins.dispatch(:check_comment_for_spam, self) + end + def notify_by_mail if source.kind_of?(Article) && article.notify_comments? if !article.profile.notification_emails.empty? -- libgit2 0.21.2