diff --git a/config/initializers/flipper.rb b/config/initializers/flipper.rb index 69a013f25f..42cee7e0d6 100644 --- a/config/initializers/flipper.rb +++ b/config/initializers/flipper.rb @@ -2,13 +2,6 @@ require "flipper" require "flipper/adapters/active_record" require "open_food_network/feature_toggle" -if Rails.env.production? - Flipper::UI.configure do |config| - config.banner_text = '⚠️ Production environment: be aware that the changes have an impact on the application. Please, read the how-to before: https://github.com/openfoodfoundation/openfoodnetwork/wiki/Feature-toggle-with-Flipper' - config.banner_class = 'danger' - end -end - Flipper.register(:admins) { |actor| actor.respond_to?(:admin?) && actor.admin? } Flipper::UI.configure do |config| @@ -20,6 +13,15 @@ Flipper::UI.configure do |config| # Defaults to false. Set to true to show feature descriptions on the list # page as well as the view page. # config.show_feature_description_in_list = true + + if Rails.env.production? + config.banner_text = <<~TEXT + ⚠️ Production environment: be aware that the changes have an impact on the + application. Please read the how-to before: + https://github.com/openfoodfoundation/openfoodnetwork/wiki/Feature-toggle-with-Flipper + TEXT + config.banner_class = 'danger' + end end # Add known feature toggles. This may fail if the database isn't setup yet.