created method to fetch incomplete submissions
Dieser Commit ist enthalten in:
Ursprung
911a47db28
Commit
15c65236e7
1 geänderte Dateien mit 5 neuen und 1 gelöschten Zeilen
|
@ -278,7 +278,7 @@ class CustomWizard::Wizard
|
|||
def current_submission
|
||||
@current_submission ||= begin
|
||||
if submissions.present?
|
||||
unsubmitted = submissions.select { |submission| !submission.submitted_at }
|
||||
unsubmitted = unsubmitted_submissions
|
||||
unsubmitted.present? ? unsubmitted.first : CustomWizard::Submission.new(self)
|
||||
else
|
||||
CustomWizard::Submission.new(self)
|
||||
|
@ -286,6 +286,10 @@ class CustomWizard::Wizard
|
|||
end
|
||||
end
|
||||
|
||||
def unsubmitted_submissions
|
||||
submissions&.select { |submission| !submission.submitted_at }
|
||||
end
|
||||
|
||||
def final_cleanup!
|
||||
if id == user.custom_fields['redirect_to_wizard']
|
||||
user.custom_fields.delete('redirect_to_wizard')
|
||||
|
|
Laden …
In neuem Issue referenzieren