Sha256: 3ec3726c3f888d2683c9075d4239697519076edb8f2cd938bea22f8730a63ada

Contents?: true

Size: 667 Bytes

Versions: 15

Compression:

Stored size: 667 Bytes

Contents

# Global visits not scoped to a patient
module Renalware
  module Clinics
    class VisitsController < BaseController
      include Renalware::Concerns::Pageable
      PER_PAGE = 25

      def index
        visits_query = VisitQuery.new(query_params)
        visits = visits_query.call.page(page).per(PER_PAGE)
        authorize visits

        render locals: {
          visits: visits,
          query: visits_query.search,
          clinics: Clinic.ordered,
          users: User.ordered
        }
      end

      private

      def query_params
        params
          .fetch(:q, {})
          .merge(page: page, per_page: per_page)
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
renalware-core-2.0.16 app/controllers/renalware/clinics/visits_controller.rb
renalware-core-2.0.15 app/controllers/renalware/clinics/visits_controller.rb
renalware-core-2.0.14 app/controllers/renalware/clinics/visits_controller.rb
renalware-core-2.0.13 app/controllers/renalware/clinics/visits_controller.rb
renalware-core-2.0.12 app/controllers/renalware/clinics/visits_controller.rb
renalware-core-2.0.11 app/controllers/renalware/clinics/visits_controller.rb
renalware-core-2.0.9 app/controllers/renalware/clinics/visits_controller.rb
renalware-core-2.0.8 app/controllers/renalware/clinics/visits_controller.rb
renalware-core-2.0.7 app/controllers/renalware/clinics/visits_controller.rb
renalware-core-2.0.5 app/controllers/renalware/clinics/visits_controller.rb
renalware-core-2.0.4 app/controllers/renalware/clinics/visits_controller.rb
renalware-core-2.0.3 app/controllers/renalware/clinics/visits_controller.rb
renalware-core-2.0.2 app/controllers/renalware/clinics/visits_controller.rb
renalware-core-2.0.1 app/controllers/renalware/clinics/visits_controller.rb
renalware-core-2.0.0 app/controllers/renalware/clinics/visits_controller.rb