fix: assigned_conversation_new_message? NoMethod error (#5225)

This commit is contained in:
Sojan Jose
2022-08-08 20:13:57 +02:00
committed by GitHub
parent a89a280a94
commit fe74a259be
2 changed files with 43 additions and 0 deletions

View File

@@ -15,6 +15,9 @@ class NotificationBuilder
def user_subscribed_to_notification?
notification_setting = user.notification_settings.find_by(account_id: account.id)
# added for the case where an assignee might be removed from the account but remains in conversation
return if notification_setting.blank?
return true if notification_setting.public_send("email_#{notification_type}?")
return true if notification_setting.public_send("push_#{notification_type}?")