Enable new customer balance for the core team

This enables the use of the new customer balance implementation to
whatever users we specify in the BETA_TESTERS env var through
ofn-install.

This var is meant to contain the user emails that will log in such as
personal accounts (I have an account with admin access to my hub) or
superadmin accounts used by the core team. This way can gather early
feedback ourselves while not releasing the new logic to users.
This commit is contained in:
Pau Perez
2020-12-15 17:30:43 +01:00
parent c79baead84
commit 6f8967f002
2 changed files with 12 additions and 0 deletions

View File

@@ -60,4 +60,11 @@ SMTP_PASSWORD: 'f00d'
# STRIPE_CLIENT_ID: "ca_xxxx" # This can be a development ID or a production ID
# STRIPE_ENDPOINT_SECRET: "whsec_xxxx"
# Feature toggles
#
# Adding user emails separated by commas will enable them the use of certain features. See
# config/initializers/feature_toggles.rb for details.
#
# BETA_TESTERS: ofn@example.com,superadmin@example.com
MEMCACHED_VALUE_MAX_MEGABYTES: '4'

View File

@@ -0,0 +1,5 @@
require 'open_food_network/feature_toggle'
beta_testers = ENV['BETA_TESTERS']&.split(/[\s,]+/)
OpenFoodNetwork::FeatureToggle.enable(:customer_balance, beta_testers)