diff options
author | Tim Bishop <tim@bishnet.net> | 2015-01-30 23:49:01 +0000 |
---|---|---|
committer | Tim Bishop <tim@bishnet.net> | 2015-01-30 23:49:01 +0000 |
commit | 0fe1c9b64869703b8d803d56955422dceabf6e37 (patch) | |
tree | 6473b304307d64558baa0d74f9159e4bb9068883 /app/models/group.rb | |
parent | 03430ad77cb36ecfb450f9e4dec28d3fff1499e3 (diff) | |
download | gitlab-ce-0fe1c9b64869703b8d803d56955422dceabf6e37.tar.gz |
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.
Diffstat (limited to 'app/models/group.rb')
-rw-r--r-- | app/models/group.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/group.rb b/app/models/group.rb index e098dfb3cdf..042b79a7850 100644 --- a/app/models/group.rb +++ b/app/models/group.rb @@ -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) |