From c46dc997222eaebb6c7fc85dff71fa96107e3df6 Mon Sep 17 00:00:00 2001 From: Phil Lee Date: Thu, 23 Jan 2025 14:52:37 +0000 Subject: [PATCH] refactor: use memoised method --- app/models/journeys/navigator.rb | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/app/models/journeys/navigator.rb b/app/models/journeys/navigator.rb index 17703a37c..d9730de39 100644 --- a/app/models/journeys/navigator.rb +++ b/app/models/journeys/navigator.rb @@ -43,20 +43,6 @@ def previous_slug def next_slug return "ineligible" if eligibility_checker.ineligible? - forms = slug_sequence.slugs.map do |slug| - form_class = journey.form_class_for_slug(slug:) - - raise "Form not found for journey: #{journey} slug: #{slug}" if form_class.nil? - - form = form_class.new( - journey:, - journey_session:, - params:, - session: - ) - form - end - if current_slug.nil? forms.first else