mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Convert if statement in case statement in product import entry validator
This commit is contained in:
@@ -293,9 +293,10 @@ module ProductImport
|
||||
end
|
||||
|
||||
def convert_to_trusted_type(untrusted_attribute, trusted_attribute)
|
||||
if trusted_attribute.is_a? Integer
|
||||
case trusted_attribute
|
||||
when Integer
|
||||
untrusted_attribute.to_i
|
||||
elsif trusted_attribute.is_a? Float
|
||||
when Float
|
||||
untrusted_attribute.to_f
|
||||
else
|
||||
untrusted_attribute.to_s
|
||||
|
||||
Reference in New Issue
Block a user