app/models/notification.rb
# TODO: move to a data presenter
# rubocop:disable Metrics/CyclomaticComplexity
move to a data presenter
rubocop:disable Metrics/CyclomaticComplexity
move to a data presenter rubocop : disable Metrics / CyclomaticComplexity
def push_message_title
    case notification_type
    when 'conversation_creation'
      I18n.t('notifications.notification_title.conversation_creation', display_id: primary_actor.display_id, inbox_name: primary_actor.inbox.name)
    when 'conversation_assignment'
      I18n.t('notifications.notification_title.conversation_assignment', display_id: primary_actor.display_id)
    when 'assigned_conversation_new_message'
      I18n.t(
        'notifications.notification_title.assigned_conversation_new_message',
        display_id: primary_actor.display_id,
        content: primary_actor&.messages&.incoming&.last&.content
      )
    when 'conversation_mention'
      I18n.t('notifications.notification_title.conversation_mention', display_id: primary_actor.conversation.display_id, name: secondary_actor.name)
    else
      ''
    end
  end
def push_message_title case notification_type when 'conversation_creation' I18n . t ( 'notifications.notification_title.conversation_creation' , display_id : primary_actor . display_id , inbox_name : primary_actor . inbox . name ) when 'conversation_assignment' I18n . t ( 'notifications.notification_title.conversation_assignment' , display_id : primary_actor . display_id ) when 'assigned_conversation_new_message' I18n . t ( 'notifications.notification_title.assigned_conversation_new_message' , display_id : primary_actor . display_id , content : primary_actor &. messages &. incoming &. last &. content ) when 'conversation_mention' I18n . t ( 'notifications.notification_title.conversation_mention' , display_id : primary_actor . conversation . display_id , name : secondary_actor . name ) else '' end end
TODO: move to a data presenter
rubocop:disable Metrics/CyclomaticComplexity
TODO : move to a data presenter rubocop : disable Metrics / CyclomaticComplexity