Mercurial > hg > soundsoftware-site
annotate app/models/comment_observer.rb @ 1327:287f201c2802 redmine-2.2-integration
Add italic
author | Chris Cannam <chris.cannam@soundsoftware.ac.uk> |
---|---|
date | Wed, 19 Jun 2013 20:56:22 +0100 |
parents | 433d4f72a19b |
children | 622f24f53b42 |
rev | line source |
---|---|
Chris@441 | 1 # Redmine - project management software |
Chris@1115 | 2 # Copyright (C) 2006-2012 Jean-Philippe Lang |
Chris@441 | 3 # |
Chris@441 | 4 # This program is free software; you can redistribute it and/or |
Chris@441 | 5 # modify it under the terms of the GNU General Public License |
Chris@441 | 6 # as published by the Free Software Foundation; either version 2 |
Chris@441 | 7 # of the License, or (at your option) any later version. |
Chris@909 | 8 # |
Chris@441 | 9 # This program is distributed in the hope that it will be useful, |
Chris@441 | 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
Chris@441 | 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
Chris@441 | 12 # GNU General Public License for more details. |
Chris@909 | 13 # |
Chris@441 | 14 # You should have received a copy of the GNU General Public License |
Chris@441 | 15 # along with this program; if not, write to the Free Software |
Chris@441 | 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
Chris@441 | 17 |
Chris@441 | 18 class CommentObserver < ActiveRecord::Observer |
Chris@441 | 19 def after_create(comment) |
Chris@441 | 20 if comment.commented.is_a?(News) && Setting.notified_events.include?('news_comment_added') |
Chris@1115 | 21 Mailer.news_comment_added(comment).deliver |
Chris@441 | 22 end |
Chris@441 | 23 end |
Chris@441 | 24 end |