Commit 14699f4b6abc4b85b0f0b3c2cfdaf0125d2b222e
1 parent
87d27329
Exists in
master
and in
22 other branches
Extract Method
Showing
1 changed file
with
5 additions
and
1 deletions
Show diff stats
app/models/comment.rb
| @@ -100,12 +100,16 @@ class Comment < ActiveRecord::Base | @@ -100,12 +100,16 @@ class Comment < ActiveRecord::Base | ||
| 100 | include Noosfero::Plugin::HotSpot | 100 | include Noosfero::Plugin::HotSpot |
| 101 | 101 | ||
| 102 | def verify_and_notify | 102 | def verify_and_notify |
| 103 | - plugins.dispatch(:check_comment_for_spam, self) | 103 | + check_for_spam |
| 104 | unless spam? | 104 | unless spam? |
| 105 | notify_by_mail | 105 | notify_by_mail |
| 106 | end | 106 | end |
| 107 | end | 107 | end |
| 108 | 108 | ||
| 109 | + def check_for_spam | ||
| 110 | + plugins.dispatch(:check_comment_for_spam, self) | ||
| 111 | + end | ||
| 112 | + | ||
| 109 | def notify_by_mail | 113 | def notify_by_mail |
| 110 | if source.kind_of?(Article) && article.notify_comments? | 114 | if source.kind_of?(Article) && article.notify_comments? |
| 111 | if !article.profile.notification_emails.empty? | 115 | if !article.profile.notification_emails.empty? |