diff --git a/controllers/custom_wizard/wizard.rb b/controllers/custom_wizard/wizard.rb index 1f259a59..539b4b80 100644 --- a/controllers/custom_wizard/wizard.rb +++ b/controllers/custom_wizard/wizard.rb @@ -69,7 +69,6 @@ class CustomWizard::WizardController < ::ApplicationController end submission.remove if submission.present? - wizard.cleanup! end render json: result diff --git a/lib/custom_wizard/wizard.rb b/lib/custom_wizard/wizard.rb index b4b3b8fd..8f5a897f 100644 --- a/lib/custom_wizard/wizard.rb +++ b/lib/custom_wizard/wizard.rb @@ -286,15 +286,11 @@ class CustomWizard::Wizard end end - def cleanup! + def final_cleanup! if id == user.custom_fields['redirect_to_wizard'] user.custom_fields.delete('redirect_to_wizard') user.save_custom_fields(true) end - end - - def final_cleanup! - cleanup! if current_submission.present? current_submission.submitted_at = Time.now.iso8601