From 85dc423f7090da0a52c73eb66faf22ddb20efff9 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Sat, 19 Sep 2020 01:45:44 +0000 Subject: Add latest changes from gitlab-org/gitlab@13-4-stable-ee --- app/models/namespace.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'app/models/namespace.rb') diff --git a/app/models/namespace.rb b/app/models/namespace.rb index e529ba6b486..527fa9d52d0 100644 --- a/app/models/namespace.rb +++ b/app/models/namespace.rb @@ -135,6 +135,10 @@ class Namespace < ApplicationRecord uniquify.string(path) { |s| Namespace.find_by_path_or_name(s) } end + def clean_name(value) + value.scan(Gitlab::Regex.group_name_regex_chars).join(' ') + end + def find_by_pages_host(host) gitlab_host = "." + Settings.pages.host.downcase host = host.downcase @@ -349,6 +353,10 @@ class Namespace < ApplicationRecord ) end + def any_project_with_pages_deployed? + all_projects.with_pages_deployed.any? + end + def closest_setting(name) self_and_ancestors(hierarchy_order: :asc) .find { |n| !n.read_attribute(name).nil? } -- cgit v1.2.1