diff options
Diffstat (limited to 'app/models/namespace.rb')
-rw-r--r-- | app/models/namespace.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/namespace.rb b/app/models/namespace.rb index 393580e0554..455429608b4 100644 --- a/app/models/namespace.rb +++ b/app/models/namespace.rb @@ -92,6 +92,8 @@ class Namespace < ApplicationRecord scope :for_user, -> { where('type IS NULL') } scope :sort_by_type, -> { order(Gitlab::Database.nulls_first_order(:type)) } scope :include_route, -> { includes(:route) } + scope :by_parent, -> (parent) { where(parent_id: parent) } + scope :filter_by_path, -> (query) { where('lower(path) = :query', query: query.downcase) } scope :with_statistics, -> do joins('LEFT JOIN project_statistics ps ON ps.namespace_id = namespaces.id') |