Sha256: edcfd303e6043d9ac78a81bcdb903eb04e993db486a863b35afa55002bf2523a

Contents?: true

Size: 820 Bytes

Versions: 8

Compression:

Stored size: 820 Bytes

Contents

require_dependency "renalware/transplants/base_controller"

module Renalware
  module Transplants
    class RecipientDashboardsController < BaseController

      def show
        authorize patient
        render locals: locals
      end

      private

      def locals
        {
          patient: patient,
          recipient_workup: RecipientWorkup.for_patient(patient).first_or_initialize,
          registration: registration_presenter,
          recipient_operations: RecipientOperation.for_patient(patient).reversed,
          donations: Donation.for_recipient(patient).reversed
        }
      end

      def registration_presenter
        WaitListRegistrationPresenter.new(registration)
      end

      def registration
        Registration.for_patient(patient).first_or_initialize
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
renalware-core-2.0.0.pre.beta11 app/controllers/renalware/transplants/recipient_dashboards_controller.rb
renalware-core-2.0.0.pre.beta10 app/controllers/renalware/transplants/recipient_dashboards_controller.rb
renalware-core-2.0.0.pre.beta9 app/controllers/renalware/transplants/recipient_dashboards_controller.rb
renalware-core-2.0.0.pre.beta8 app/controllers/renalware/transplants/recipient_dashboards_controller.rb
renalware-core-2.0.0.pre.beta7 app/controllers/renalware/transplants/recipient_dashboards_controller.rb
renalware-core-2.0.0.pre.beta6 app/controllers/renalware/transplants/recipient_dashboards_controller.rb
renalware-core-2.0.0.pre.beta5 app/controllers/renalware/transplants/recipient_dashboards_controller.rb
renalware-core-2.0.0.pre.beta4 app/controllers/renalware/transplants/recipient_dashboards_controller.rb