diff options
Diffstat (limited to 'app/models/operations/feature_flags')
-rw-r--r-- | app/models/operations/feature_flags/user_list.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/app/models/operations/feature_flags/user_list.rb b/app/models/operations/feature_flags/user_list.rb index b9bdcb59d5f..3e492eaa892 100644 --- a/app/models/operations/feature_flags/user_list.rb +++ b/app/models/operations/feature_flags/user_list.rb @@ -5,6 +5,7 @@ module Operations class UserList < ApplicationRecord include AtomicInternalId include IidRoutes + include ::Gitlab::SQL::Pattern self.table_name = 'operations_user_lists' @@ -12,7 +13,7 @@ module Operations has_many :strategy_user_lists has_many :strategies, through: :strategy_user_lists - has_internal_id :iid, scope: :project, init: ->(s) { s&.project&.operations_feature_flags_user_lists&.maximum(:iid) }, presence: true + has_internal_id :iid, scope: :project, presence: true validates :project, presence: true validates :name, @@ -23,6 +24,10 @@ module Operations before_destroy :ensure_no_associated_strategies + scope :for_name_like, -> (query) do + fuzzy_search(query, [:name], use_minimum_char_limit: false) + end + private def ensure_no_associated_strategies |