summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-08-01 00:02:07 +0000
committerStan Hu <stanhu@gmail.com>2019-08-01 00:02:07 +0000
commitcfb7f11644d41bedc423865caa28b4266840f8e4 (patch)
treea822a2fcd2f8d6d24c8651cb6b8a054b2fd3dd18 /lib
parentb36323f3d26131405925bf86742b2b4acd786230 (diff)
parent31e419e945f8058be58487057bf77c338ca8f536 (diff)
downloadgitlab-ce-cfb7f11644d41bedc423865caa28b4266840f8e4.tar.gz
Merge branch '65363-add-feature-remove' into 'master'
Add Feature.remove Closes #65363 See merge request gitlab-org/gitlab-ce!31315
Diffstat (limited to 'lib')
-rw-r--r--lib/feature.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/feature.rb b/lib/feature.rb
index e28333aa58e..c70a6980f19 100644
--- a/lib/feature.rb
+++ b/lib/feature.rb
@@ -80,6 +80,13 @@ class Feature
get(key).disable_group(group)
end
+ def remove(key)
+ feature = get(key)
+ return unless persisted?(feature)
+
+ feature.remove
+ end
+
def flipper
if Gitlab::SafeRequestStore.active?
Gitlab::SafeRequestStore[:flipper] ||= build_flipper_instance