diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-20 12:09:13 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-20 12:09:13 +0300 |
commit | 1ac794623a8be5dee111716a44dd04ff708f3541 (patch) | |
tree | 6c18f9fbe0bd9978bd3e8d9b083d3a0ca180686e /app/models/namespace.rb | |
parent | 5247fe0bef72fa922841a79d5dbefb47d95112fa (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/namespace.rb')
-rw-r--r-- | app/models/namespace.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/namespace.rb b/app/models/namespace.rb index efe14a3e614..99212d09b8e 100644 --- a/app/models/namespace.rb +++ b/app/models/namespace.rb @@ -68,6 +68,7 @@ class Namespace < ApplicationRecord after_destroy :rm_dir scope :for_user, -> { where('type IS NULL') } + scope :sort_by_type, -> { order(Gitlab::Database.nulls_first_order(:type)) } scope :with_statistics, -> do joins('LEFT JOIN project_statistics ps ON ps.namespace_id = namespaces.id') @@ -326,7 +327,10 @@ class Namespace < ApplicationRecord end def pages_virtual_domain - Pages::VirtualDomain.new(all_projects_with_pages, trim_prefix: full_path) + Pages::VirtualDomain.new( + all_projects_with_pages.includes(:route, :project_feature), + trim_prefix: full_path + ) end def closest_setting(name) |