1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-01 12:24:28 +01:00

(feat) search by username (#401)

This commit is contained in:
Sylvain 2022-10-24 10:17:07 +02:00
commit 50138ece51

View File

@ -54,7 +54,8 @@ class Members::ListService
.where("users.is_active = 'true'")
.limit(50)
query.downcase.split(' ').each do |word|
members = members.where('lower(f_unaccent(profiles.first_name)) ~ :search OR ' \
members = members.where('lower(f_unaccent(users.username)) ~ :search OR ' \
'lower(f_unaccent(profiles.first_name)) ~ :search OR ' \
'lower(f_unaccent(profiles.last_name)) ~ :search',
search: word)
end