set post correctly

This commit is contained in:
Dennis Collinson & Michael Sofaer 2011-06-27 19:17:33 -07:00 committed by Michael Sofaer & Raphael Sofaer
parent f9e8e7a041
commit 839756573d

View file

@ -33,10 +33,7 @@ class NotificationsController < VannaController
notifications.each do |n|
n[:actors] = n.actors
n[:translation_key] = n.popup_translation_key
if n.translation_key == "notifications.mentioned"
n[:target] = n[:target].post
end
# Go find out if the post exists, and set the target_id to nil if it doesn't
n[:target] = n.translation_key == "notifications.mentioned" ? n.target.post : n.target
end
group_days = notifications.group_by{|note| I18n.l(note.created_at, :format => I18n.t('date.formats.fullmonth_day')) }
{:group_days => group_days, :notifications => notifications}