Commit 1e9e3fc7 authored by Hannes Rosenögger's avatar Hannes Rosenögger

Make the project search case insensitive

parent d84a2ab6
...@@ -2,7 +2,7 @@ Note: The upcoming release contains empty lines to reduce the number of merge co ...@@ -2,7 +2,7 @@ Note: The upcoming release contains empty lines to reduce the number of merge co
v 7.8.0 v 7.8.0
- Replace highlight.js with rouge-fork rugments (Stefan Tatschner) - Replace highlight.js with rouge-fork rugments (Stefan Tatschner)
- - Make project search case insensitive (Hannes Rosenögger)
- -
- -
- -
......
...@@ -183,7 +183,7 @@ class Project < ActiveRecord::Base ...@@ -183,7 +183,7 @@ class Project < ActiveRecord::Base
end end
def search(query) def search(query)
joins(:namespace).where("projects.archived = ?", false).where("projects.name LIKE :query OR projects.path LIKE :query OR namespaces.name LIKE :query OR projects.description LIKE :query", query: "%#{query}%") joins(:namespace).where("projects.archived = ?", false).where("LOWER(projects.name) LIKE :query OR LOWER(projects.path) LIKE :query OR LOWER(namespaces.name) LIKE :query OR LOWER(projects.description) LIKE :query", query: "%#{query.downcase}%")
end end
def search_by_title(query) def search_by_title(query)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment