From ef883b2fc817980b9c296d7cf3d1dee0eed875be Mon Sep 17 00:00:00 2001 From: Kat Date: Wed, 1 Mar 2023 15:29:54 +0000 Subject: [PATCH] Remove mortgageused method --- app/services/imports/sales_logs_import_service.rb | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/app/services/imports/sales_logs_import_service.rb b/app/services/imports/sales_logs_import_service.rb index 2dce3c0ca..d1c7e88e6 100644 --- a/app/services/imports/sales_logs_import_service.rb +++ b/app/services/imports/sales_logs_import_service.rb @@ -111,7 +111,7 @@ module Imports attributes["prevten"] = unsafe_string_as_integer(xml_doc, "Q6PrevTenure") attributes["mortlen"] = mortgage_length(xml_doc, attributes) attributes["extrabor"] = borrowing(xml_doc, attributes) - attributes["mortgageused"] = mortgage_used(xml_doc, attributes) + attributes["mortgageused"] = unsafe_string_as_integer(xml_doc, "MORTGAGEUSED") attributes["wchair"] = unsafe_string_as_integer(xml_doc, "Q15Wheelchair") attributes["armedforcesspouse"] = unsafe_string_as_integer(xml_doc, "ARMEDFORCESSPOUSE") attributes["hodate"] = compose_date(xml_doc, "HODAY", "HOMONTH", "HOYEAR") @@ -399,15 +399,6 @@ module Imports end end - def mortgage_used(xml_doc, attributes) - mortgage_used = unsafe_string_as_integer(xml_doc, "MORTGAGEUSED") - if mortgage_used == 3 - [attributes["mortgage"], attributes["mortlen"], attributes["extrabor"]].any?(&:present?) ? 1 : 2 - else - mortgage_used - end - end - def ownership_from_type(attributes) case attributes["type"] when 2, 24, 18, 16, 28, 31, 30