Commit 77adf81e authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix tests

parent b78c38e9
...@@ -183,7 +183,12 @@ class Project < ActiveRecord::Base ...@@ -183,7 +183,12 @@ class Project < ActiveRecord::Base
end end
def search(query) def search(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}%") 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.try(: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