Commit d8f2e73e authored by Steven Fuchs's avatar Steven Fuchs

refer to model for target value, not set attributes.

parent 12575bd7
......@@ -45,6 +45,10 @@ class Notification < ActiveRecord::Base
raise NotImplementedError.new('Subclass this.')
end
def effective_target
self.popup_translation_key == "notifications.mentioned" ? self.target.post : self.target
end
private
def self.concatenate_or_create(recipient, target, actor, notification_type)
return nil if suppress_notification?(recipient, target)
......
......@@ -18,9 +18,9 @@
.span-8.notifications_for_day
- notes.each do |note|
.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
= aspect_membership_dropdown(contact, note[:target], 'left')
= aspect_membership_dropdown(contact, note.effective_target, 'left')
%span.from
= notification_message_for(note)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment