Skip to content

Commit

Permalink
refactor: use memoised method
Browse files Browse the repository at this point in the history
  • Loading branch information
asmega committed Jan 23, 2025
1 parent 47fd15c commit c46dc99
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions app/models/journeys/navigator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c46dc99

Please sign in to comment.