Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-22 17:30:29 +01:00
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
|
def current_submission
|
||||||
@current_submission ||= begin
|
@current_submission ||= begin
|
||||||
if submissions.present?
|
if submissions.present?
|
||||||
unsubmitted = submissions.select { |submission| !submission.submitted_at }
|
unsubmitted = unsubmitted_submissions
|
||||||
unsubmitted.present? ? unsubmitted.first : CustomWizard::Submission.new(self)
|
unsubmitted.present? ? unsubmitted.first : CustomWizard::Submission.new(self)
|
||||||
else
|
else
|
||||||
CustomWizard::Submission.new(self)
|
CustomWizard::Submission.new(self)
|
||||||
|
@ -286,6 +286,10 @@ class CustomWizard::Wizard
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def unsubmitted_submissions
|
||||||
|
submissions&.select { |submission| !submission.submitted_at }
|
||||||
|
end
|
||||||
|
|
||||||
def final_cleanup!
|
def final_cleanup!
|
||||||
if id == user.custom_fields['redirect_to_wizard']
|
if id == user.custom_fields['redirect_to_wizard']
|
||||||
user.custom_fields.delete('redirect_to_wizard')
|
user.custom_fields.delete('redirect_to_wizard')
|
||||||
|
|
Laden …
In neuem Issue referenzieren