From 6d2765e352b486ee32fbd8dceaf92577eeea1ac4 Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Tue, 29 Jan 2019 23:53:37 +0000 Subject: [PATCH] Convert if statement in case statement in product import entry validator --- app/models/product_import/entry_validator.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/models/product_import/entry_validator.rb b/app/models/product_import/entry_validator.rb index 89a6d26ccc..ce4907c045 100644 --- a/app/models/product_import/entry_validator.rb +++ b/app/models/product_import/entry_validator.rb @@ -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