refer to model for target value, not set attributes.

This commit is contained in:
Steven Fuchs 2012-01-23 12:05:43 -05:00
parent 12575bd7f0
commit d8f2e73ea2
2 changed files with 6 additions and 2 deletions

View file

@ -45,6 +45,10 @@ class Notification < ActiveRecord::Base
raise NotImplementedError.new('Subclass this.') raise NotImplementedError.new('Subclass this.')
end end
def effective_target
self.popup_translation_key == "notifications.mentioned" ? self.target.post : self.target
end
private private
def self.concatenate_or_create(recipient, target, actor, notification_type) def self.concatenate_or_create(recipient, target, actor, notification_type)
return nil if suppress_notification?(recipient, target) return nil if suppress_notification?(recipient, target)

View file

@ -18,9 +18,9 @@
.span-8.notifications_for_day .span-8.notifications_for_day
- notes.each do |note| - notes.each do |note|
.stream_element{:data=>{:guid => note.id}, :class => "#{note.unread ? 'unread' : 'read'}"} .stream_element{:data=>{:guid => note.id}, :class => "#{note.unread ? 'unread' : 'read'}"}
- if note.type == "Notifications::StartedSharing" && contact = current_user.contact_for(note[:target]) - if note.type == "Notifications::StartedSharing" && contact = current_user.contact_for(note.effective_target)
.right .right
= aspect_membership_dropdown(contact, note[:target], 'left') = aspect_membership_dropdown(contact, note.effective_target, 'left')
%span.from %span.from
= notification_message_for(note) = notification_message_for(note)