0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-25 10:40:28 +01:00

Handle incorrect use of inputs

If the user mis-configures the wizard, e.g. using "is" instead of "=" it will produce an exception here in certain circumstances. This prevents that.
Dieser Commit ist enthalten in:
Angus McLeod 2020-09-21 15:50:46 +10:00
Ursprung fd0dfeae32
Commit e34a24c495

Datei anzeigen

@ -137,8 +137,10 @@ class CustomWizard::Mapper
elsif ["true", "false"].include?(value)
result = key.public_send(operator, ActiveRecord::Type::Boolean.new.cast(value))
end
else
elsif [key, value, operator].all? { |i| !i.nil? }
result = key.public_send(operator, value)
else
result = false
end
if operator == '=~'