summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAsh McKenzie <amckenzie@gitlab.com>2019-07-31 10:41:11 +1000
committerAsh McKenzie <amckenzie@gitlab.com>2019-08-01 08:29:14 +1000
commit31e419e945f8058be58487057bf77c338ca8f536 (patch)
treeec3d2a48935a6adef5cd1a897a3613d020bf3b76 /lib
parenta4e084461e6d3f5e0323f802c779e164fbd71abf (diff)
downloadgitlab-ce-31e419e945f8058be58487057bf77c338ca8f536.tar.gz
Add new Feature.remove method65363-add-feature-remove
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