Class: Renalware::Letters::Part::Problems
- Inherits:
-
DumbDelegator
- Object
- DumbDelegator
- Renalware::Letters::Part::Problems
- Defined in:
- app/models/renalware/letters/part/problems.rb
Instance Method Summary collapse
-
#initialize(patient, _letter, _event = Event::Unknown.new) ⇒ Problems
constructor
A new instance of Problems.
-
#to_partial_path ⇒ Object
If you are wondering why #to_partial_path is not getting called when doing ‘render part’ in a view, note this object is array-like so Rails’ render only looks for #to_partial_path on the array elements, not the top level arrary object.
Methods inherited from DumbDelegator
#inspect, #public_send, #send, #try, #try!
Constructor Details
#initialize(patient, _letter, _event = Event::Unknown.new) ⇒ Problems
Returns a new instance of Problems.
8 9 10 11 |
# File 'app/models/renalware/letters/part/problems.rb', line 8 def initialize(patient, _letter, _event = Event::Unknown.new) @patient = patient super(patient.problems.includes(:notes)) end |
Instance Method Details
#to_partial_path ⇒ Object
If you are wondering why #to_partial_path is not getting called when doing ‘render part’ in a view, note this object is array-like so Rails’ render only looks for #to_partial_path on the array elements, not the top level arrary object. To render a single instance of this part class, wrap it in an array like so:
= render [part]
18 19 20 |
# File 'app/models/renalware/letters/part/problems.rb', line 18 def to_partial_path "renalware/letters/parts/problems" end |