Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-10 04:12:53 +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
|
def perform
|
||||||
multiple = @opts[:multiple]
|
multiple = @opts[:multiple]
|
||||||
perform_result = multiple ? [] : nil
|
perform_result = multiple ? [] : nil
|
||||||
|
input_size = inputs.size
|
||||||
|
|
||||||
inputs.each do |input|
|
inputs.each_with_index do |input, index|
|
||||||
input_type = input['type']
|
input_type = input['type']
|
||||||
pairs = input['pairs']
|
pairs = input['pairs']
|
||||||
|
|
||||||
|
@ -69,6 +70,8 @@ class CustomWizard::Mapper
|
||||||
|
|
||||||
if multiple
|
if multiple
|
||||||
perform_result.push(result)
|
perform_result.push(result)
|
||||||
|
elsif result != true && index < (input_size - 1)
|
||||||
|
next
|
||||||
else
|
else
|
||||||
perform_result = result
|
perform_result = result
|
||||||
break
|
break
|
||||||
|
|
Laden …
In neuem Issue referenzieren