refer to model for target value, not set attributes.
This commit is contained in:
parent
12575bd7f0
commit
d8f2e73ea2
2 changed files with 6 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue