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