Fix group search to check path as well as name.

The API documentation says:

"You can search for groups by name or path with: /groups?search=Rails"

But you can't because the search query only checks the name, not
the path. This fixes that.
This commit is contained in:
Tim Bishop 2015-01-30 23:49:01 +00:00
parent 03430ad77c
commit 0fe1c9b648
1 changed files with 1 additions and 1 deletions

View File

@ -91,7 +91,7 @@ class Group < Namespace
class << self
def search(query)
where("LOWER(namespaces.name) LIKE :query", query: "%#{query.downcase}%")
where("LOWER(namespaces.name) LIKE :query or LOWER(namespaces.path) LIKE :query", query: "%#{query.downcase}%")
end
def sort(method)