diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-02 09:09:10 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-02 09:09:10 +0300 |
commit | 951a32fcf3fc8766eae1430a389b77049410c371 (patch) | |
tree | 284b8298b4de14dc2f31b9ef2cdfe3d90ace7296 /app/models/operations | |
parent | ceb0c326ae57bac76fe40ca3471b0ee5d152f58e (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/operations')
-rw-r--r-- | app/models/operations/feature_flag.rb | 6 | ||||
-rw-r--r-- | app/models/operations/feature_flag_scope.rb | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/app/models/operations/feature_flag.rb b/app/models/operations/feature_flag.rb index 450a5970ad8..46810749b18 100644 --- a/app/models/operations/feature_flag.rb +++ b/app/models/operations/feature_flag.rb @@ -17,6 +17,7 @@ module Operations has_internal_id :iid, scope: :project default_value_for :active, true + default_value_for :version, :new_version_flag # scopes exists only for the first version has_many :scopes, class_name: 'Operations::FeatureFlagScope' @@ -39,8 +40,6 @@ module Operations validate :first_default_scope, on: :create, if: :has_scopes? validate :version_associations - before_create :build_default_scope, if: -> { legacy_flag? && scopes.none? } - accepts_nested_attributes_for :scopes, allow_destroy: true accepts_nested_attributes_for :strategies, allow_destroy: true @@ -52,7 +51,6 @@ module Operations scope :new_version_only, -> { where(version: :new_version_flag)} enum version: { - legacy_flag: 1, new_version_flag: 2 } @@ -127,8 +125,6 @@ module Operations def version_associations if new_version_flag? && scopes.any? errors.add(:version_associations, 'version 2 feature flags may not have scopes') - elsif legacy_flag? && strategies.any? - errors.add(:version_associations, 'version 1 feature flags may not have strategies') end end diff --git a/app/models/operations/feature_flag_scope.rb b/app/models/operations/feature_flag_scope.rb index 78be29f2531..9068ca0f588 100644 --- a/app/models/operations/feature_flag_scope.rb +++ b/app/models/operations/feature_flag_scope.rb @@ -1,5 +1,9 @@ # frozen_string_literal: true +# All of the legacy flags have been removed in 14.1, including all of the +# `operations_feature_flag_scopes` rows. Therefore, this model and the database +# table are unused and should be removed. + module Operations class FeatureFlagScope < ApplicationRecord prepend HasEnvironmentScope |