Sha256: 66beb8a442d40e8b83e41619cddfc95e4848b915bc7af70c973f71395c29c3e2

Contents?: true

Size: 763 Bytes

Versions: 121

Compression:

Stored size: 763 Bytes

Contents

# frozen_string_literal: true

require "renalware/letters/part"

module Renalware
  module Letters
    class Part::Problems < DumbDelegator
      def initialize(patient, _letter, _event = Event::Unknown.new)
        @patient = patient
        super(patient.problems.includes(:notes))
      end

      # 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]
      def to_partial_path
        "renalware/letters/parts/problems"
      end
    end
  end
end

Version data entries

121 entries across 121 versions & 1 rubygems

Version Path
renalware-core-2.0.147 app/models/renalware/letters/part/problems.rb
renalware-core-2.0.146 app/models/renalware/letters/part/problems.rb
renalware-core-2.0.145 app/models/renalware/letters/part/problems.rb
renalware-core-2.0.144 app/models/renalware/letters/part/problems.rb
renalware-core-2.0.143 app/models/renalware/letters/part/problems.rb
renalware-core-2.0.142 app/models/renalware/letters/part/problems.rb
renalware-core-2.0.141 app/models/renalware/letters/part/problems.rb
renalware-core-2.0.140 app/models/renalware/letters/part/problems.rb
renalware-core-2.0.139 app/models/renalware/letters/part/problems.rb
renalware-core-2.0.138 app/models/renalware/letters/part/problems.rb
renalware-core-2.0.137 app/models/renalware/letters/part/problems.rb
renalware-core-2.0.136 app/models/renalware/letters/part/problems.rb
renalware-core-2.0.135 app/models/renalware/letters/part/problems.rb
renalware-core-2.0.134 app/models/renalware/letters/part/problems.rb
renalware-core-2.0.133 app/models/renalware/letters/part/problems.rb
renalware-core-2.0.132 app/models/renalware/letters/part/problems.rb
renalware-core-2.0.131 app/models/renalware/letters/part/problems.rb
renalware-core-2.0.130 app/models/renalware/letters/part/problems.rb
renalware-core-2.0.129 app/models/renalware/letters/part/problems.rb
renalware-core-2.0.128 app/models/renalware/letters/part/problems.rb