Sha256: cb54b680ab5b0377f4e4f02a96bdb1a5fe09314c6607d5274c9cfbcf3328dfb2

Contents?: true

Size: 868 Bytes

Versions: 15

Compression:

Stored size: 868 Bytes

Contents

# frozen_string_literal: true

require_dependency "renalware"

# Note we rely on template inheritance with this MDM Base class i.e. subclasses (e.g.
# HD::MDMPatientsController) can override templates and partials (e.g. add a _filters partial
# or override the _patient partial to replace what is displayed in the table).
# Otherwise the default template location is of course app/views/renalware/mdm_patients.
module Renalware
  class UsersController < BaseController
    include Pagy::Backend

    def index
      query = params.fetch(:q, {})
      query[:s] ||= "family_name"
      search = User
        .includes(:roles)
        .where.not(username: [:rwdev, :systemuser])
        .ransack(query)
      pagy, users = pagy(search.result(distinct: true))
      authorize users
      render locals: { users: users, pagy: pagy, user_search: search }
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
renalware-core-2.1.1 app/controllers/renalware/users_controller.rb
renalware-core-2.1.0 app/controllers/renalware/users_controller.rb
renalware-core-2.0.167 app/controllers/renalware/users_controller.rb
renalware-core-2.0.166 app/controllers/renalware/users_controller.rb
renalware-core-2.0.165 app/controllers/renalware/users_controller.rb
renalware-core-2.0.164 app/controllers/renalware/users_controller.rb
renalware-core-2.0.163 app/controllers/renalware/users_controller.rb
renalware-core-2.0.162 app/controllers/renalware/users_controller.rb
renalware-core-2.0.161 app/controllers/renalware/users_controller.rb
renalware-core-2.0.160 app/controllers/renalware/users_controller.rb
renalware-core-2.0.159 app/controllers/renalware/users_controller.rb
renalware-core-2.0.158 app/controllers/renalware/users_controller.rb
renalware-core-2.0.157 app/controllers/renalware/users_controller.rb
renalware-core-2.0.156 app/controllers/renalware/users_controller.rb
renalware-core-2.0.155 app/controllers/renalware/users_controller.rb