mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Remove on-the-fly adding of feature toggle entries
We now have a new source of truth. You shouldn't use a feature toggle without adding it to OpenFoodNetwork::FeatureToggle first. All toggles are added at boot time already.
This commit is contained in:
@@ -60,9 +60,7 @@ module OpenFoodNetwork
|
||||
end
|
||||
|
||||
def self.enabled?(feature_name, user = nil)
|
||||
feature = Flipper.feature(feature_name)
|
||||
feature.add unless feature.exist?
|
||||
feature.enabled?(user)
|
||||
Flipper.enabled?(feature_name, user)
|
||||
end
|
||||
|
||||
def self.disabled?(feature_name, user = nil)
|
||||
|
||||
@@ -13,13 +13,6 @@ module OpenFoodNetwork
|
||||
Flipper.enable(:foo)
|
||||
expect(FeatureToggle.enabled?(:foo)).to be true
|
||||
end
|
||||
|
||||
it "adds features to the database for easy admin in the UI" do
|
||||
feature = Flipper.feature(:sparkling_new)
|
||||
|
||||
expect { FeatureToggle.enabled?(:sparkling_new) }.
|
||||
to change { feature.exist? }.from(false).to(true)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user