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.1.1 app/models/renalware/letters/part/problems.rb
renalware-core-2.1.0 app/models/renalware/letters/part/problems.rb
renalware-core-2.0.167 app/models/renalware/letters/part/problems.rb
renalware-core-2.0.166 app/models/renalware/letters/part/problems.rb
renalware-core-2.0.165 app/models/renalware/letters/part/problems.rb
renalware-core-2.0.164 app/models/renalware/letters/part/problems.rb
renalware-core-2.0.163 app/models/renalware/letters/part/problems.rb
renalware-core-2.0.162 app/models/renalware/letters/part/problems.rb
renalware-core-2.0.161 app/models/renalware/letters/part/problems.rb
renalware-core-2.0.160 app/models/renalware/letters/part/problems.rb
renalware-core-2.0.159 app/models/renalware/letters/part/problems.rb
renalware-core-2.0.158 app/models/renalware/letters/part/problems.rb
renalware-core-2.0.157 app/models/renalware/letters/part/problems.rb
renalware-core-2.0.156 app/models/renalware/letters/part/problems.rb
renalware-core-2.0.155 app/models/renalware/letters/part/problems.rb
renalware-core-2.0.153 app/models/renalware/letters/part/problems.rb
renalware-core-2.0.152 app/models/renalware/letters/part/problems.rb
renalware-core-2.0.151 app/models/renalware/letters/part/problems.rb
renalware-core-2.0.149 app/models/renalware/letters/part/problems.rb
renalware-core-2.0.148 app/models/renalware/letters/part/problems.rb