From 1d624131d60fc4397676ed02a6458d8333603c80 Mon Sep 17 00:00:00 2001 From: Jack <113976590+bibblobcode@users.noreply.github.com> Date: Thu, 26 Jan 2023 12:17:45 +0000 Subject: [PATCH] Use interruption_screen? method (#1238) More safe than checking whether the question included value_check in their name --- app/models/form.rb | 2 +- app/views/form/page.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/form.rb b/app/models/form.rb index 5f6544086..179c56526 100644 --- a/app/models/form.rb +++ b/app/models/form.rb @@ -61,7 +61,7 @@ class Form page_ids = subsection_for_page(page).pages.map(&:id) page_index = page_ids.index(page.id) - page_id = if page.id.include?("value_check") && log[page.questions[0].id] == 1 && page.routed_to?(log, current_user) + page_id = if page.interruption_screen? && log[page.questions[0].id] == 1 && page.routed_to?(log, current_user) previous_page(page_ids, page_index, log, current_user) else page_ids[page_index + 1] diff --git a/app/views/form/page.html.erb b/app/views/form/page.html.erb index 7a860c1db..c7b18cdda 100644 --- a/app/views/form/page.html.erb +++ b/app/views/form/page.html.erb @@ -44,7 +44,7 @@ <%= f.hidden_field :page, value: @page.id %>