Class: Notifications::MentionedInComment

Inherits:
Notification show all
Includes:
Mentioned
Defined in:
app/models/notifications/mentioned_in_comment.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Mentioned

#linked_object

Methods inherited from Notification

concatenate_or_create, create_notification, #email_the_user, for, #linked_object, #set_read_state

Methods included from Diaspora::Fields::Guid

included, #set_guid

Class Method Details

.filter_mentions(mentions, mentionable, _recipient_user_ids) ⇒ Object


15
16
17
# File 'app/models/notifications/mentioned_in_comment.rb', line 15

def self.filter_mentions(mentions, mentionable, _recipient_user_ids)
  mentions.includes(:person).merge(Person.allowed_to_be_mentioned_in_a_comment_to(mentionable.parent))
end

Instance Method Details

#deleted_translation_keyObject


11
12
13
# File 'app/models/notifications/mentioned_in_comment.rb', line 11

def deleted_translation_key
  "notifications.mentioned_in_comment_deleted"
end

#mail_jobObject


19
20
21
22
23
24
25
26
27
# File 'app/models/notifications/mentioned_in_comment.rb', line 19

def mail_job
  if !recipient.user_preferences.exists?(email_type: "mentioned_in_comment")
    Workers::Mail::MentionedInComment
  elsif shareable.author.owner_id == recipient_id
    Workers::Mail::CommentOnPost
  elsif shareable.participants.local.where(owner_id: recipient_id)
    Workers::Mail::AlsoCommented
  end
end

7
8
9
# File 'app/models/notifications/mentioned_in_comment.rb', line 7

def popup_translation_key
  "notifications.mentioned_in_comment"
end