Files
openfoodnetwork/config/initializers/feature_toggles.rb
Jean-Baptiste Bellet d97b46cd5b add new feature for beta testers: unit_price
The aim of this "feature toggle" is to enable the unit price display for each product/variants.
By default activate on both development and staging environment.
2021-02-16 15:26:21 +01:00

16 lines
378 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
OpenFoodNetwork::FeatureToggle.enable(:unit_price) do
['development', 'staging'].include?(ENV['RAILS_ENV'])
end