mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-25 20:46:48 +00:00
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.
12 lines
263 B
Ruby
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
|