From 6f8967f002e1e75ad1a4b6ba6edd92fd5affc0cf Mon Sep 17 00:00:00 2001 From: Pau Perez Date: Tue, 15 Dec 2020 17:30:43 +0100 Subject: [PATCH] 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. --- config/application.yml.example | 7 +++++++ config/initializers/feature_toggles.rb | 5 +++++ 2 files changed, 12 insertions(+) create mode 100644 config/initializers/feature_toggles.rb diff --git a/config/application.yml.example b/config/application.yml.example index 99b8bf4fe8..2b93ead158 100644 --- a/config/application.yml.example +++ b/config/application.yml.example @@ -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' diff --git a/config/initializers/feature_toggles.rb b/config/initializers/feature_toggles.rb new file mode 100644 index 0000000000..13d083979c --- /dev/null +++ b/config/initializers/feature_toggles.rb @@ -0,0 +1,5 @@ +require 'open_food_network/feature_toggle' + +beta_testers = ENV['BETA_TESTERS']&.split(/[\s,]+/) + +OpenFoodNetwork::FeatureToggle.enable(:customer_balance, beta_testers)