FIX: filter conditionally excluded fields from wizard submission
Dieser Commit ist enthalten in:
Ursprung
743af8edc5
Commit
957a32cf5a
1 geänderte Dateien mit 6 neuen und 0 gelöschten Zeilen
|
@ -243,10 +243,16 @@ class CustomWizard::Wizard
|
||||||
return nil unless save_submissions
|
return nil unless save_submissions
|
||||||
|
|
||||||
submissions.pop(1) if unfinished?
|
submissions.pop(1) if unfinished?
|
||||||
|
submission = filter_conditional_fields(submission)
|
||||||
submissions.push(submission)
|
submissions.push(submission)
|
||||||
set_submissions(submissions)
|
set_submissions(submissions)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def filter_conditional_fields(submission)
|
||||||
|
included_fields = steps.map { |s| s.fields.map { |f| f.id } }.flatten
|
||||||
|
submission.select { |key, _| included_fields.include?(key) }
|
||||||
|
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