diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-11-24 11:45:19 +0100 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-11-24 17:28:50 +0100 |
commit | aedd2cfa5b82c01f82ec26b64880fce2a07fe942 (patch) | |
tree | e8c2094d81b86a471fdbb9de4f4a279ec0a0ef75 /app/models/group.rb | |
parent | b355ebc4c9b38320366d7640ecf51da23fbb7ea1 (diff) | |
download | gitlab-ce-aedd2cfa5b82c01f82ec26b64880fce2a07fe942.tar.gz |
Use Gitlab::SQL::Pattern where appropriate
Diffstat (limited to 'app/models/group.rb')
-rw-r--r-- | app/models/group.rb | 14 |
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 |