Commit c90df301 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Merge branch '331414-ignore-labels-remove-on-close-column' into 'master'

Ignore labels remove_on_close column

See merge request gitlab-org/gitlab!62246
parents 4b625a91 59dc7072
...@@ -9,6 +9,10 @@ class Label < ApplicationRecord ...@@ -9,6 +9,10 @@ class Label < ApplicationRecord
include Sortable include Sortable
include FromUnion include FromUnion
include Presentable include Presentable
include IgnorableColumns
# TODO: Project#create_labels can remove column exception when this column is dropped from all envs
ignore_column :remove_on_close, remove_with: '14.1', remove_after: '2021-06-22'
cache_markdown_field :description, pipeline: :single_line cache_markdown_field :description, pipeline: :single_line
......
...@@ -1420,7 +1420,8 @@ class Project < ApplicationRecord ...@@ -1420,7 +1420,8 @@ class Project < ApplicationRecord
# rubocop: disable CodeReuse/ServiceClass # rubocop: disable CodeReuse/ServiceClass
def create_labels def create_labels
Label.templates.each do |label| Label.templates.each do |label|
params = label.attributes.except('id', 'template', 'created_at', 'updated_at', 'type') # TODO: remove_on_close exception can be removed after the column is dropped from all envs
params = label.attributes.except('id', 'template', 'created_at', 'updated_at', 'type', 'remove_on_close')
Labels::FindOrCreateService.new(nil, self, params).execute(skip_authorization: true) Labels::FindOrCreateService.new(nil, self, params).execute(skip_authorization: true)
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment