0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-09-19 23:31:11 +02:00

improved the logic to accomodate multiple conditions using 'or'

Dieser Commit ist enthalten in:
Faizaan Gagan 2021-04-22 23:50:26 +05:30
Ursprung ceef3f4bc9
Commit 911140fde3

Datei anzeigen

@ -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