Don't hardcode news model in Comment.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@12026 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
0e3dfa8de4
commit
9ca8b20d55
|
@ -29,8 +29,9 @@ class Comment < ActiveRecord::Base
|
||||||
private
|
private
|
||||||
|
|
||||||
def send_notification
|
def send_notification
|
||||||
if commented.is_a?(News) && Setting.notified_events.include?('news_comment_added')
|
mailer_method = "#{commented.class.name.underscore}_comment_added"
|
||||||
Mailer.news_comment_added(self).deliver
|
if Setting.notified_events.include?(mailer_method)
|
||||||
|
Mailer.send(mailer_method, self).deliver
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue