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:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-05-12 15:08:30 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-05-12 15:08:30 +0300
commitcb3b9f9243555b0c26145e2992a9f01f7fa47bf5 (patch)
tree5fea3438f0c21330e2fba8c958cbc505810ab990 /app/models/work_items
parent71d34aac9a0fae0507c265929767422391816b01 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/work_items')
-rw-r--r--app/models/work_items/type.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/work_items/type.rb b/app/models/work_items/type.rb
index e2d38dc9903..0d390fa131d 100644
--- a/app/models/work_items/type.rb
+++ b/app/models/work_items/type.rb
@@ -41,6 +41,10 @@ module WorkItems
scope :by_type, ->(base_type) { where(base_type: base_type) }
def self.default_by_type(type)
+ found_type = find_by(namespace_id: nil, base_type: type)
+ return found_type if found_type
+
+ Gitlab::DatabaseImporters::WorkItems::BaseTypeImporter.upsert_types
find_by(namespace_id: nil, base_type: type)
end