Class: Renalware::Admissions::ActiveConsultAlertComponent
- Inherits:
-
Renalware::ApplicationComponent
- Object
- ViewComponent::Base
- Renalware::ApplicationComponent
- Renalware::Admissions::ActiveConsultAlertComponent
- Defined in:
- app/components/renalware/admissions/active_consult_alert_component.rb
Overview
rubocop:disable Rails/Pick
Instance Method Summary collapse
Methods inherited from Renalware::ApplicationComponent
Instance Method Details
#consult_id ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'app/components/renalware/admissions/active_consult_alert_component.rb', line 9 def consult_id @consult_id ||= begin Consult .where(patient_id: patient.id, ended_on: nil) .order(started_on: :desc) .pluck(:id) .first end end |
#render? ⇒ Boolean
19 20 21 |
# File 'app/components/renalware/admissions/active_consult_alert_component.rb', line 19 def render? consult_id.present? end |