Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-25 18:50:27 +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:
Ursprung
fd0dfeae32
Commit
e34a24c495
1 geänderte Dateien mit 3 neuen und 1 gelöschten Zeilen
|
@ -137,8 +137,10 @@ class CustomWizard::Mapper
|
||||||
elsif ["true", "false"].include?(value)
|
elsif ["true", "false"].include?(value)
|
||||||
result = key.public_send(operator, ActiveRecord::Type::Boolean.new.cast(value))
|
result = key.public_send(operator, ActiveRecord::Type::Boolean.new.cast(value))
|
||||||
end
|
end
|
||||||
else
|
elsif [key, value, operator].all? { |i| !i.nil? }
|
||||||
result = key.public_send(operator, value)
|
result = key.public_send(operator, value)
|
||||||
|
else
|
||||||
|
result = false
|
||||||
end
|
end
|
||||||
|
|
||||||
if operator == '=~'
|
if operator == '=~'
|
||||||
|
|
Laden …
In neuem Issue referenzieren