Change the user search query to be case insensitive.
This commit is contained in:
parent
961d87937b
commit
1aabfcb92d
|
@ -1,6 +1,7 @@
|
|||
v 6.8.0
|
||||
- Ability to at mention users that are participating in issue and merge req. discussion
|
||||
- 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)
|
||||
- Make user search case-insensitive (Christopher Arnold)
|
||||
|
||||
v 6.7.2
|
||||
- Fix upgrader script
|
||||
|
|
|
@ -204,7 +204,7 @@ class User < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def search query
|
||||
where("name LIKE :query OR email LIKE :query OR username LIKE :query", query: "%#{query}%")
|
||||
where("lower(name) LIKE :query OR lower(email) LIKE :query OR lower(username) LIKE :query", query: "%#{query.downcase}%")
|
||||
end
|
||||
|
||||
def by_username_or_id(name_or_id)
|
||||
|
|
Loading…
Reference in New Issue