Sha256: 35da9391c736485b8e49021f389ab1b1536fae60ffa6695172f35a9e5ea2ebee
Contents?: true
Size: 658 Bytes
Versions: 35
Compression:
Stored size: 658 Bytes
Contents
# frozen_string_literal: true module Renalware module Messaging class UnreadMessagesComponent < ApplicationComponent attr_reader :current_user def initialize(current_user:) @current_user = Messaging::Internal.cast_recipient(current_user) end def unread_message_receipts @unread_message_receipts ||= begin receipts = current_user .receipts .includes(message: [:author, :patient]) .order("messaging_messages.sent_at asc") .unread CollectionPresenter.new(receipts, Messaging::Internal::ReceiptPresenter) end end end end end
Version data entries
35 entries across 35 versions & 1 rubygems