From be92f3866cbae66760cdaca009dd9ea90f426d76 Mon Sep 17 00:00:00 2001 From: zhitomirskiyi Date: Mon, 17 Jan 2011 14:44:35 -0800 Subject: [PATCH] IZ MS fix 500 on commnet notificaions --- app/helpers/notifications_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/notifications_helper.rb b/app/helpers/notifications_helper.rb index a051311fe..e5c739667 100644 --- a/app/helpers/notifications_helper.rb +++ b/app/helpers/notifications_helper.rb @@ -8,14 +8,14 @@ module NotificationsHelper when 'new_request' translation when 'comment_on_post' - comment = Comment.first(:id => note.target_id) + comment = Comment.where(:id => note.target_id).first if comment "#{translation} #{link_to t('notifications.post'), object_path(comment.post)}".html_safe else "#{translation} #{t('notifications.deleted')} #{t('notifications.post')}" end when 'also_commented' - comment = Comment.first(:id => note.target_id) + comment = Comment.where(:id => note.target_id).first if comment "#{translation} #{link_to t('notifications.post'), object_path(comment.post)}".html_safe else