a bad fix for a 500 on notification show when the post is deleted
This commit is contained in:
parent
0da4466da2
commit
c2c6c00db8
2 changed files with 7 additions and 1 deletions
|
|
@ -8,7 +8,12 @@ module NotificationsHelper
|
||||||
when 'new_request'
|
when 'new_request'
|
||||||
translation
|
translation
|
||||||
when 'comment_on_post'
|
when 'comment_on_post'
|
||||||
"#{translation} #{link_to t('notifications.post'), object_path(Comment.first(:id => note.target_id).post)}".html_safe
|
comment = Comment.first(:id => note.target_id)
|
||||||
|
if comment
|
||||||
|
"#{translation} #{link_to t('notifications.post'), object_path(comment.post)}".html_safe
|
||||||
|
else
|
||||||
|
"#{translation} #{t('notifications.deleted')} #{t('notifications.post')}"
|
||||||
|
end
|
||||||
else
|
else
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -188,6 +188,7 @@ en:
|
||||||
new_request: "offered to share with you."
|
new_request: "offered to share with you."
|
||||||
comment_on_post: "commented on your"
|
comment_on_post: "commented on your"
|
||||||
post: 'post'
|
post: 'post'
|
||||||
|
deleted: 'deleted'
|
||||||
index:
|
index:
|
||||||
notifications: "Notifications"
|
notifications: "Notifications"
|
||||||
users:
|
users:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue