Skip to content

Commit 89c444b

Browse files
committed
Admin - Searching user is case insensitive
1 parent e620dcf commit 89c444b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

app/controllers/admin/users_controller.rb

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
class Admin::UsersController < AdminController
22
def index
3+
downcase_params if params[:q].present?
34
@q = User.includes(:editor).ransack(params[:q])
45
@users = @q.result(distinct: true).page(params[:page])
56
end
@@ -51,4 +52,8 @@ def user_update_params
5152
def provider_klass
5253
Kernel.const_get("API#{namespace.classify}::Provider")
5354
end
55+
56+
def downcase_params
57+
params[:q][:email_or_authorization_requests_siret_or_authorization_requests_external_id_eq] = params[:q][:email_or_authorization_requests_siret_or_authorization_requests_external_id_eq].downcase if params[:q][:email_or_authorization_requests_siret_or_authorization_requests_external_id_eq].present?
58+
end
5459
end

0 commit comments

Comments
 (0)