Case-insensetive search autocomplete for projets

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
Dmitriy Zaporozhets 2014-01-18 16:22:57 +02:00
parent 757e92d52e
commit 712a2ec4fd
No known key found for this signature in database
GPG key ID: 627C5F589F467F17

View file

@ -139,7 +139,7 @@ class Project < ActiveRecord::Base
end end
def search_by_title query def search_by_title query
where("projects.archived = ?", false).where("projects.name LIKE :query", query: "%#{query}%") where("projects.archived = ?", false).where("LOWER(projects.name) LIKE :query", query: "%#{query.downcase}%")
end end
def find_with_namespace(id) def find_with_namespace(id)