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:
Maikel Linke
2023-03-22 14:40:20 +11:00
parent 9a1b1498bf
commit fd68cbf56d
2 changed files with 1 additions and 10 deletions

View File

@@ -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)

View File

@@ -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