summaryrefslogtreecommitdiff
path: root/lib/feature.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/feature.rb')
-rw-r--r--lib/feature.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/feature.rb b/lib/feature.rb
index b89e5176a08..2e2b343f82c 100644
--- a/lib/feature.rb
+++ b/lib/feature.rb
@@ -20,6 +20,13 @@ class Feature
flipper.feature(key)
end
+ def persisted?(feature)
+ # Flipper creates on-memory features when asked for a not-yet-created one.
+ # If we want to check if a feature has been actually set, we look for it
+ # on the persisted features list.
+ all.map(&:name).include?(feature.name)
+ end
+
private
def flipper