From b7796424228bf455577b96232ac94bea79b96534 Mon Sep 17 00:00:00 2001 From: Angus McLeod Date: Thu, 29 Aug 2019 10:22:02 +1000 Subject: [PATCH] Properly clean up route_to after it's used --- lib/builder.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/builder.rb b/lib/builder.rb index 16e65cf4..9f50239a 100644 --- a/lib/builder.rb +++ b/lib/builder.rb @@ -148,6 +148,10 @@ class CustomWizard::Builder end final_step = updater.step.next.nil? + + if route_to = data['route_to'] + data.delete('route_to') + end if @wizard.save_submissions && updater.errors.empty? save_submissions(data, final_step) @@ -162,8 +166,8 @@ class CustomWizard::Builder if updater.errors.empty? if final_step - updater.result[:redirect_on_complete] = data['route_to'] || data['redirect_on_complete'] - elsif route_to = data['route_to'] + updater.result[:redirect_on_complete] = route_to || data['redirect_on_complete'] + elsif updater.result[:redirect_on_next] = route_to end end