Class: Renalware::Events::EventsPresenter
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Renalware::Events::EventsPresenter
- Defined in:
- app/presenters/renalware/events/events_presenter.rb
Instance Attribute Summary collapse
-
#patient ⇒ Object
readonly
Returns the value of attribute patient.
Instance Method Summary collapse
- #event_types_for_filtering ⇒ Object
-
#initialize(patient, events) ⇒ EventsPresenter
constructor
A new instance of EventsPresenter.
- #users_for_filtering ⇒ Object
Constructor Details
#initialize(patient, events) ⇒ EventsPresenter
Returns a new instance of EventsPresenter.
10 11 12 13 |
# File 'app/presenters/renalware/events/events_presenter.rb', line 10 def initialize(patient, events) @patient = patient super(events) end |
Instance Attribute Details
#patient ⇒ Object (readonly)
Returns the value of attribute patient.
8 9 10 |
# File 'app/presenters/renalware/events/events_presenter.rb', line 8 def patient @patient end |
Instance Method Details
#event_types_for_filtering ⇒ Object
21 22 23 24 25 26 |
# File 'app/presenters/renalware/events/events_presenter.rb', line 21 def event_types_for_filtering Events::Type .where(id: all_event_type_ids_in_use_for_this_patient) .distinct .order(name: :asc) end |
#users_for_filtering ⇒ Object
15 16 17 18 19 |
# File 'app/presenters/renalware/events/events_presenter.rb', line 15 def users_for_filtering User.where(id: ids_of_users_having_created_events_for_this_patient) .distinct .order(family_name: :asc) end |