summaryrefslogtreecommitdiff
path: root/app/models/namespace.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-08 12:06:01 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-08 12:06:01 +0000
commit9865665cb15a1f63e6c4d0623d33b8ef11810f8d (patch)
tree25458d0f21cf25896af750ed6933bbc4efcdb909 /app/models/namespace.rb
parent77a7772c3bdb03d92cbc154f6b1a762953cc7c19 (diff)
downloadgitlab-ce-9865665cb15a1f63e6c4d0623d33b8ef11810f8d.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/namespace.rb')
-rw-r--r--app/models/namespace.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/namespace.rb b/app/models/namespace.rb
index 7c0220a705a..5663ebf8ba1 100644
--- a/app/models/namespace.rb
+++ b/app/models/namespace.rb
@@ -316,6 +316,12 @@ class Namespace < ApplicationRecord
Pages::VirtualDomain.new(all_projects_with_pages, trim_prefix: full_path)
end
+ def closest_setting(name)
+ self_and_ancestors(hierarchy_order: :asc)
+ .find { |n| !n.read_attribute(name).nil? }
+ .try(name)
+ end
+
private
def all_projects_with_pages