From 47346cfbd8b42de8703780ee81411e52595fa5d2 Mon Sep 17 00:00:00 2001 From: Kat Date: Tue, 8 Nov 2022 16:40:08 +0000 Subject: [PATCH] Extract feature toggle --- app/views/locations/show.html.erb | 2 +- config/initializers/feature_toggle.rb | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/views/locations/show.html.erb b/app/views/locations/show.html.erb index 2060a6e0f..bacfaacc1 100644 --- a/app/views/locations/show.html.erb +++ b/app/views/locations/show.html.erb @@ -23,6 +23,6 @@ <% end %> -<% if !Rails.env.production? %> +<% if FeatureToggle.location_toggle_enabled? %> <%= govuk_button_link_to "Deactivate this location", location_deactivate_path(location_id: @location.id, id: @scheme.id), warning: true %> <% end %> diff --git a/config/initializers/feature_toggle.rb b/config/initializers/feature_toggle.rb index ca4315e9e..d3ab1db57 100644 --- a/config/initializers/feature_toggle.rb +++ b/config/initializers/feature_toggle.rb @@ -14,4 +14,10 @@ class FeatureToggle false end + + def self.location_toggle_enabled? + return true unless Rails.env.production? + + false + end end