class AppTriageTableComponent
Public Class Methods
Source
# File app/components/app_triage_table_component.rb, line 4 def initialize(patient:, session:, programme:) @patient = patient @session = session @programme = programme end
Public Instance Methods
Source
# File app/components/app_triage_table_component.rb, line 10 def render? = triages.any? private attr_reader :patient, :session, :programme delegate :govuk_table, :triage_status_tag, to: :helpers delegate :academic_year, to: :session def triages @triages ||= patient .triages .includes(:performed_by) .for_programme(programme) .where(academic_year:) .order(created_at: :desc) end end
Source
# File app/components/app_triage_table_component.rb, line 19 def triages @triages ||= patient .triages .includes(:performed_by) .for_programme(programme) .where(academic_year:) .order(created_at: :desc) end