diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-12 15:08:30 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-12 15:08:30 +0300 |
commit | cb3b9f9243555b0c26145e2992a9f01f7fa47bf5 (patch) | |
tree | 5fea3438f0c21330e2fba8c958cbc505810ab990 /app/models/work_items | |
parent | 71d34aac9a0fae0507c265929767422391816b01 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/work_items')
-rw-r--r-- | app/models/work_items/type.rb | 4 |
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 |