diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-18 12:45:46 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-18 12:45:46 +0300 |
commit | a7b3560714b4d9cc4ab32dffcd1f74a284b93580 (patch) | |
tree | 7452bd5c3545c2fa67a28aa013835fb4fa071baf /app/models/project_setting.rb | |
parent | ee9173579ae56a3dbfe5afe9f9410c65bb327ca7 (diff) |
Add latest changes from gitlab-org/gitlab@14-8-stable-eev14.8.0-rc42
Diffstat (limited to 'app/models/project_setting.rb')
-rw-r--r-- | app/models/project_setting.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/app/models/project_setting.rb b/app/models/project_setting.rb index 4e37174e604..ae3d7038a88 100644 --- a/app/models/project_setting.rb +++ b/app/models/project_setting.rb @@ -1,6 +1,10 @@ # 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' + belongs_to :project, inverse_of: :project_setting enum squash_option: { @@ -12,8 +16,12 @@ class ProjectSetting < ApplicationRecord self.primary_key = :project_id - validates :merge_commit_template, length: { maximum: 500 } - validates :squash_commit_template, length: { maximum: 500 } + validates :merge_commit_template, length: { maximum: Project::MAX_COMMIT_TEMPLATE_LENGTH } + validates :squash_commit_template, length: { maximum: Project::MAX_COMMIT_TEMPLATE_LENGTH } + + default_value_for(:legacy_open_source_license_available) do + Feature.enabled?(:legacy_open_source_license_available, default_enabled: :yaml, type: :ops) + end def squash_enabled_by_default? %w[always default_on].include?(squash_option) |