diff options
Diffstat (limited to 'app/models/namespace.rb')
-rw-r--r-- | app/models/namespace.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/namespace.rb b/app/models/namespace.rb index a7d03c3688a..be39b894ef9 100644 --- a/app/models/namespace.rb +++ b/app/models/namespace.rb @@ -167,6 +167,7 @@ class Namespace < ApplicationRecord 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 :in_organization, -> (organization) { where(organization: organization) } scope :with_statistics, -> do joins('LEFT JOIN project_statistics ps ON ps.namespace_id = namespaces.id') |