Sha256: 0ba1bf5570fcd91e9aa260ae9bbc93f955f39eb986a8642c9e6898cf8a9b311c

Contents?: true

Size: 484 Bytes

Versions: 17

Compression:

Stored size: 484 Bytes

Contents

# frozen_string_literal: true

module Renalware
  module Events
    class BiopsiesComponent < ApplicationComponent
      validates :patient, presence: true

      def initialize(patient:, limit: 6)
        @patient = patient
        relation = Biopsy.for_patient(patient).includes(:created_by)
        @biopsies = relation.limit(limit).ordered
        @total_biopsies = relation.count
      end

      private

      attr_reader :patient, :biopsies, :total_biopsies
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
renalware-core-2.0.149 app/components/renalware/events/biopsies_component.rb
renalware-core-2.0.148 app/components/renalware/events/biopsies_component.rb
renalware-core-2.0.147 app/components/renalware/events/biopsies_component.rb
renalware-core-2.0.146 app/components/renalware/events/biopsies_component.rb
renalware-core-2.0.145 app/components/renalware/events/biopsies_component.rb
renalware-core-2.0.144 app/components/renalware/events/biopsies_component.rb
renalware-core-2.0.143 app/components/renalware/events/biopsies_component.rb
renalware-core-2.0.142 app/components/renalware/events/biopsies_component.rb
renalware-core-2.0.141 app/components/renalware/events/biopsies_component.rb
renalware-core-2.0.140 app/components/renalware/events/biopsies_component.rb
renalware-core-2.0.139 app/components/renalware/events/biopsies_component.rb
renalware-core-2.0.138 app/components/renalware/events/biopsies_component.rb
renalware-core-2.0.137 app/components/renalware/events/biopsies_component.rb
renalware-core-2.0.136 app/components/renalware/events/biopsies_component.rb
renalware-core-2.0.135 app/components/renalware/events/biopsies_component.rb
renalware-core-2.0.134 app/components/renalware/events/biopsies_component.rb
renalware-core-2.0.133 app/components/renalware/events/biopsies_component.rb