Commit 1aabfcb92d41f690e6756a7f057e85f17e30a0db
1 parent
961d8793
Exists in
spb-stable
and in
3 other branches
Change the user search query to be case insensitive.
Showing
2 changed files
with
2 additions
and
1 deletions
Show diff stats
CHANGELOG
1 | 1 | v 6.8.0 |
2 | 2 | - Ability to at mention users that are participating in issue and merge req. discussion |
3 | 3 | - Enabled GZip Compression for assets in example Nginx, make sure that Nginx is compiled with --with-http_gzip_static_module flag (this is default in Ubuntu) |
4 | + - Make user search case-insensitive (Christopher Arnold) | |
4 | 5 | |
5 | 6 | v 6.7.2 |
6 | 7 | - Fix upgrader script | ... | ... |
app/models/user.rb
... | ... | @@ -204,7 +204,7 @@ class User < ActiveRecord::Base |
204 | 204 | end |
205 | 205 | |
206 | 206 | def search query |
207 | - where("name LIKE :query OR email LIKE :query OR username LIKE :query", query: "%#{query}%") | |
207 | + where("lower(name) LIKE :query OR lower(email) LIKE :query OR lower(username) LIKE :query", query: "%#{query.downcase}%") | |
208 | 208 | end |
209 | 209 | |
210 | 210 | def by_username_or_id(name_or_id) | ... | ... |