Consistently use our FeatureToggle module

Direct calls to Flipper have the downside that we can't add any new
functionality like storing the feature in the database when used.
This commit is contained in:
Maikel Linke
2022-10-06 09:33:58 +11:00
committed by Konrad
parent bc26a3aa07
commit 52e934ec2b
10 changed files with 33 additions and 21 deletions

View File

@@ -40,7 +40,7 @@ module Api
end
def restrict_feature
not_found unless Flipper.enabled?(:api_v1, @current_api_user)
not_found unless OpenFoodNetwork::FeatureToggle.enabled?(:api_v1, @current_api_user)
end
def current_ability