From f4f3a302b97e622c5525e523560cf3500e04eb64 Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Tue, 21 Aug 2018 15:43:06 +0200 Subject: [PATCH] Do not rely on rails env to detect staging --- app/helpers/application_helper.rb | 4 ++++ app/views/layouts/application.html.haml | 2 +- app/views/layouts/new_application.html.haml | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 0cf7d51dd..1c0695d97 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -50,6 +50,10 @@ module ApplicationHelper current_administrateur&.email end + def staging? + ENV['APP_NAME'] == 'tps_dev' + end + def root_path_for_profile(nav_bar_profile) case nav_bar_profile when :gestionnaire diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index be9304b91..714c643bb 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -23,7 +23,7 @@ %body = render partial: 'layouts/support_navigator_banner' = render partial: 'layouts/pre_maintenance' - - if Rails.env == 'staging' + - if staging? #beta Env Test diff --git a/app/views/layouts/new_application.html.haml b/app/views/layouts/new_application.html.haml index 268c24f61..5664fbf75 100644 --- a/app/views/layouts/new_application.html.haml +++ b/app/views/layouts/new_application.html.haml @@ -29,7 +29,7 @@ .page-wrapper = render partial: "layouts/support_navigator_banner" = render partial: 'layouts/pre_maintenance' - - if Rails.env == "staging" + - if staging? #beta Env Test