mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
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.
16 lines
378 B
Ruby
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
|