Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/template/base_template.rb')
-rw-r--r--lib/gitlab/template/base_template.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/gitlab/template/base_template.rb b/lib/gitlab/template/base_template.rb
index 0f933a61598..dc006877129 100644
--- a/lib/gitlab/template/base_template.rb
+++ b/lib/gitlab/template/base_template.rb
@@ -87,11 +87,11 @@ module Gitlab
raise NotImplementedError
end
- def by_category(category, project = nil)
+ def by_category(category, project = nil, empty_category_title: nil)
directory = category_directory(category)
files = finder(project).list_files_for(directory)
- files.map { |f| new(f, project, category: category) }.sort
+ files.map { |f| new(f, project, category: category.presence || empty_category_title) }.sort
end
def category_directory(category)
@@ -108,7 +108,7 @@ module Gitlab
# Gitaly the actual template names within a given project's repository for all file templates
# other than `issue` and `merge request` description templates, which would instead
# overwrite the `template_names` method to return a redis cached version, by reading cached values
- # from `repository.issue_template_names_by_category` and `repository.merge_request_template_names_by_category`
+ # from `repository.issue_template_names_hash` and `repository.merge_request_template_names_hash`
# methods.
def repository_template_names(project)
template_names_by_category(self.all(project))