From cd698ce8003cc5517436ae09a628685dc5b67fee Mon Sep 17 00:00:00 2001 From: Muhsin Keloth Date: Wed, 14 Feb 2024 16:11:21 +0530 Subject: [PATCH] chore: push title --- app/models/notification.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/models/notification.rb b/app/models/notification.rb index e0b31b457..6da3605fa 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -115,6 +115,18 @@ class Notification < ApplicationRecord primary_actor end + def conversation_creation_message_content + "#{conversation.messages.first&.sender&.name}: #{conversation.messages.first&.content}" + end + + def message_created_message_content + "#{secondary_actor&.sender&.name}: #{secondary_actor&.content}" + end + + def mention_content + "#{secondary_actor&.sender&.name}: #{transform_user_mention_content(secondary_actor&.content&.truncate_words(10) || '')}" + end + def content transform_user_mention_content(secondary_actor&.content&.truncate_words(10) || '') end