Browse Source

Put redirect to duplicate logs path behind a feature flag

pull/1763/head
Kat 3 years ago
parent
commit
7f370081da
  1. 2
      app/controllers/form_controller.rb
  2. 4
      app/services/feature_toggle.rb

2
app/controllers/form_controller.rb

@ -155,6 +155,7 @@ private
end end
def successful_redirect_path def successful_redirect_path
if FeatureToggle.deduplication_flow_enabled?
if @log.lettings? if @log.lettings?
if current_user.lettings_logs.duplicate_logs(@log).count.positive? if current_user.lettings_logs.duplicate_logs(@log).count.positive?
return send("lettings_log_duplicate_logs_path", @log) return send("lettings_log_duplicate_logs_path", @log)
@ -162,6 +163,7 @@ private
elsif current_user.sales_logs.duplicate_logs(@log).count.positive? elsif current_user.sales_logs.duplicate_logs(@log).count.positive?
return send("sales_log_duplicate_logs_path", @log) return send("sales_log_duplicate_logs_path", @log)
end end
end
if is_referrer_type?("check_answers") if is_referrer_type?("check_answers")
next_page_id = form.next_page_id(@page, @log, current_user) next_page_id = form.next_page_id(@page, @log, current_user)

4
app/services/feature_toggle.rb

@ -33,4 +33,8 @@ class FeatureToggle
def self.new_data_protection_confirmation? def self.new_data_protection_confirmation?
true true
end end
def self.deduplication_flow_enabled?
!Rails.env.production?
end
end end

Loading…
Cancel
Save