Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-22 01:10:28 +01:00
improved the logic to accomodate multiple conditions using 'or'
Dieser Commit ist enthalten in:
Ursprung
ceef3f4bc9
Commit
911140fde3
1 geänderte Dateien mit 4 neuen und 1 gelöschten Zeilen
|
@ -45,8 +45,9 @@ class CustomWizard::Mapper
|
|||
def perform
|
||||
multiple = @opts[:multiple]
|
||||
perform_result = multiple ? [] : nil
|
||||
input_size = inputs.size
|
||||
|
||||
inputs.each do |input|
|
||||
inputs.each_with_index do |input, index|
|
||||
input_type = input['type']
|
||||
pairs = input['pairs']
|
||||
|
||||
|
@ -69,6 +70,8 @@ class CustomWizard::Mapper
|
|||
|
||||
if multiple
|
||||
perform_result.push(result)
|
||||
elsif result != true && index < (input_size - 1)
|
||||
next
|
||||
else
|
||||
perform_result = result
|
||||
break
|
||||
|
|
Laden …
In neuem Issue referenzieren