Files
openfoodnetwork/config/initializers/feature_toggles.rb
Pau Perez 14cee0e45d Add new Feature class to toggle based on a closure
This enables toggling features as best fits us in each case. With this
new approach we can then toggle :customer_balance to an entire instance,
which is what we want in France.
2021-02-04 10:20:54 +01:00

12 lines
263 B
Ruby

require 'open_food_network/feature_toggle'
beta_testers = ENV['BETA_TESTERS']&.split(/[\s,]+/) || []
OpenFoodNetwork::FeatureToggle.enable(:customer_balance) do |user|
if beta_testers == ['all']
true
else
beta_testers.include?(user.email)
end
end