diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-07-15 20:53:23 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-07-15 20:53:23 +0000 |
commit | 9ca8b20d55343494fff3bd6de5a47f51f490b896 (patch) | |
tree | 450e6800ba2852710d4dd424665b10170726eed3 /app/models/comment.rb | |
parent | 0e3dfa8de47e281e7a86940d72fb9cdfc1e5e8f0 (diff) | |
download | redmine-9ca8b20d55343494fff3bd6de5a47f51f490b896.tar.gz redmine-9ca8b20d55343494fff3bd6de5a47f51f490b896.zip |
Don't hardcode news model in Comment.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@12026 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/comment.rb')
-rw-r--r-- | app/models/comment.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/models/comment.rb b/app/models/comment.rb index ac60e497c..d108cb103 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -29,8 +29,9 @@ class Comment < ActiveRecord::Base private def send_notification - if commented.is_a?(News) && Setting.notified_events.include?('news_comment_added') - Mailer.news_comment_added(self).deliver + mailer_method = "#{commented.class.name.underscore}_comment_added" + if Setting.notified_events.include?(mailer_method) + Mailer.send(mailer_method, self).deliver end end end |