Class: Renalware::Hospitals::WardPresenter

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
app/presenters/renalware/hospitals/ward_presenter.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.units_with_wardsObject



16
17
18
# File 'app/presenters/renalware/hospitals/ward_presenter.rb', line 16

def self.units_with_wards
  Hospitals::Unit.eager_load(:wards).merge(Hospitals::Ward.active)
end

Instance Method Details

#titleObject



8
9
10
# File 'app/presenters/renalware/hospitals/ward_presenter.rb', line 8

def title
  code.blank? ? name : "#{name} (#{code})"
end

#title_including_unitObject



12
13
14
# File 'app/presenters/renalware/hospitals/ward_presenter.rb', line 12

def title_including_unit
  "#{title} at #{hospital_unit.unit_code}"
end