diff --git a/CHANGELOG b/CHANGELOG index 0b295e4d7594f4cd884a2e42500b9fa0407ae293..06d19df7a326a08eace0e096954aec54f008048e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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 diff --git a/app/models/user.rb b/app/models/user.rb index d9f420759d2db5e82afa267fee6b2bc9f2b98ea3..25c10a6faa0e5738d453588004d12bdca26e228a 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -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)