summaryrefslogtreecommitdiff
path: root/app/models/group.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-11-24 11:45:19 +0100
committerDouwe Maan <douwe@selenight.nl>2017-11-24 17:28:50 +0100
commitaedd2cfa5b82c01f82ec26b64880fce2a07fe942 (patch)
treee8c2094d81b86a471fdbb9de4f4a279ec0a0ef75 /app/models/group.rb
parentb355ebc4c9b38320366d7640ecf51da23fbb7ea1 (diff)
downloadgitlab-ce-aedd2cfa5b82c01f82ec26b64880fce2a07fe942.tar.gz
Use Gitlab::SQL::Pattern where appropriate
Diffstat (limited to 'app/models/group.rb')
-rw-r--r--app/models/group.rb14
1 files changed, 0 insertions, 14 deletions
diff --git a/app/models/group.rb b/app/models/group.rb
index dc4500360b9..76262acf50c 100644
--- a/app/models/group.rb
+++ b/app/models/group.rb
@@ -50,20 +50,6 @@ class Group < Namespace
Gitlab::Database.postgresql?
end
- # Searches for groups matching the given query.
- #
- # This method uses ILIKE on PostgreSQL and LIKE on MySQL.
- #
- # query - The search query as a String
- #
- # Returns an ActiveRecord::Relation.
- def search(query)
- table = Namespace.arel_table
- pattern = "%#{query}%"
-
- where(table[:name].matches(pattern).or(table[:path].matches(pattern)))
- end
-
def sort(method)
if method == 'storage_size_desc'
# storage_size is a virtual column so we need to