diff --git a/app/controllers/apply_signatures_controller.rb b/app/controllers/apply_signatures_controller.rb index 150b323f..e867c44d 100644 --- a/app/controllers/apply_signatures_controller.rb +++ b/app/controllers/apply_signatures_controller.rb @@ -7,7 +7,7 @@ class ApplySignaturesController < ApplicationController def index search = params[:search].to_s.downcase @apply_signatures = @project.apply_signatures.with_status(status).includes(user: :user_extension) - @apply_signatures = @apply_signatures.joins(:user).where("LOWER(concat(users.lastname, users.firstname, users.login, users.mail, users.nickname)) LIKE ?", "%#{search.split(" ").join('|')}%") if search.present? + @apply_signatures = @apply_signatures.joins(:user).where("LOWER(CONCAT_WS(users.lastname, users.firstname, users.login, users.mail, users.nickname)) LIKE ?", "%#{search.split(" ").join('|')}%") if search.present? @apply_signatures = kaminari_paginate(@apply_signatures) end diff --git a/app/controllers/members_controller.rb b/app/controllers/members_controller.rb index b8c0ea54..302dc624 100644 --- a/app/controllers/members_controller.rb +++ b/app/controllers/members_controller.rb @@ -18,7 +18,7 @@ class MembersController < ApplicationController scope = @project.members.includes(:roles, user: :user_extension) search = params[:search].to_s.downcase role = params[:role].to_s - scope = scope.joins(:user).where("LOWER(concat(users.lastname, users.firstname, users.login, users.mail, users.nickname)) LIKE ?", "%#{search.split(" ").join('|')}%") if search.present? + scope = scope.joins(:user).where("LOWER(CONCAT_WS(users.lastname, users.firstname, users.login, users.mail, users.nickname)) LIKE ?", "%#{search.split(" ").join('|')}%") if search.present? scope = scope.joins(:roles).where("roles.name LIKE ?", "%#{role}%") if role.present? @total_count = scope.size