Sha256: 5d17c0c3b35892b0d47a5f8d5b6047cb09d58fd181d0faed9449c891e4e4ff09

Contents?: true

Size: 605 Bytes

Versions: 10

Compression:

Stored size: 605 Bytes

Contents

# frozen_string_literal: true

module Renalware
  module Letters
    class UnreadElectronicCCsComponent < ApplicationComponent
      include Pundit::Helper

      pattr_initialize [:current_user!]

      def unread_electronic_ccs
        @unread_electronic_ccs ||= begin
          receipts = Letters::ElectronicReceipt
            .includes(letter: [:patient, :author, :letterhead])
            .unread
            .for_recipient(current_user.id)
            .order(created_at: :asc)
          CollectionPresenter.new(receipts, Letters::ElectronicReceiptPresenter)
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
renalware-core-2.1.1 app/components/renalware/letters/unread_electronic_ccs_component.rb
renalware-core-2.1.0 app/components/renalware/letters/unread_electronic_ccs_component.rb
renalware-core-2.0.167 app/components/renalware/letters/unread_electronic_ccs_component.rb
renalware-core-2.0.166 app/components/renalware/letters/unread_electronic_ccs_component.rb
renalware-core-2.0.165 app/components/renalware/letters/unread_electronic_ccs_component.rb
renalware-core-2.0.164 app/components/renalware/letters/unread_electronic_ccs_component.rb
renalware-core-2.0.163 app/components/renalware/letters/unread_electronic_ccs_component.rb
renalware-core-2.0.162 app/components/renalware/letters/unread_electronic_ccs_component.rb
renalware-core-2.0.161 app/components/renalware/letters/unread_electronic_ccs_component.rb
renalware-core-2.0.160 app/components/renalware/letters/unread_electronic_ccs_component.rb