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:
Diffstat (limited to 'app/models/project_setting.rb')
-rw-r--r--app/models/project_setting.rb12
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)