diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-20 10:00:54 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-20 10:00:54 +0000 |
commit | 3cccd102ba543e02725d247893729e5c73b38295 (patch) | |
tree | f36a04ec38517f5deaaacb5acc7d949688d1e187 /app/models/project_setting.rb | |
parent | 205943281328046ef7b4528031b90fbda70c75ac (diff) | |
download | gitlab-ce-3cccd102ba543e02725d247893729e5c73b38295.tar.gz |
Add latest changes from gitlab-org/gitlab@14-10-stable-eev14.10.0-rc42
Diffstat (limited to 'app/models/project_setting.rb')
-rw-r--r-- | app/models/project_setting.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/app/models/project_setting.rb b/app/models/project_setting.rb index ae3d7038a88..6cd6eee2616 100644 --- a/app/models/project_setting.rb +++ b/app/models/project_setting.rb @@ -1,9 +1,7 @@ # frozen_string_literal: true class ProjectSetting < ApplicationRecord - include IgnorableColumns - - ignore_column :show_diff_preview_in_email, remove_with: '14.10', remove_after: '2022-03-22' + ALLOWED_TARGET_PLATFORMS = %w(ios osx tvos watchos).freeze belongs_to :project, inverse_of: :project_setting @@ -18,6 +16,9 @@ class ProjectSetting < ApplicationRecord validates :merge_commit_template, length: { maximum: Project::MAX_COMMIT_TEMPLATE_LENGTH } validates :squash_commit_template, length: { maximum: Project::MAX_COMMIT_TEMPLATE_LENGTH } + validates :target_platforms, inclusion: { in: ALLOWED_TARGET_PLATFORMS } + + validate :validates_mr_default_target_self default_value_for(:legacy_open_source_license_available) do Feature.enabled?(:legacy_open_source_license_available, default_enabled: :yaml, type: :ops) @@ -31,7 +32,9 @@ class ProjectSetting < ApplicationRecord %w[always never].include?(squash_option) end - validate :validates_mr_default_target_self + def target_platforms=(val) + super(val&.map(&:to_s)&.sort) + end private |