IZ MS fix 500 on commnet notificaions

This commit is contained in:
zhitomirskiyi 2011-01-17 14:44:35 -08:00
parent 68f2528f23
commit be92f3866c

View file

@ -8,14 +8,14 @@ module NotificationsHelper
when 'new_request' when 'new_request'
translation translation
when 'comment_on_post' when 'comment_on_post'
comment = Comment.first(:id => note.target_id) comment = Comment.where(:id => note.target_id).first
if comment if comment
"#{translation} #{link_to t('notifications.post'), object_path(comment.post)}".html_safe "#{translation} #{link_to t('notifications.post'), object_path(comment.post)}".html_safe
else else
"#{translation} #{t('notifications.deleted')} #{t('notifications.post')}" "#{translation} #{t('notifications.deleted')} #{t('notifications.post')}"
end end
when 'also_commented' when 'also_commented'
comment = Comment.first(:id => note.target_id) comment = Comment.where(:id => note.target_id).first
if comment if comment
"#{translation} #{link_to t('notifications.post'), object_path(comment.post)}".html_safe "#{translation} #{link_to t('notifications.post'), object_path(comment.post)}".html_safe
else else