Browse Source

Remove mortgageused method

pull/1353/head
Kat 3 years ago
parent
commit
ef883b2fc8
  1. 11
      app/services/imports/sales_logs_import_service.rb

11
app/services/imports/sales_logs_import_service.rb

@ -111,7 +111,7 @@ module Imports
attributes["prevten"] = unsafe_string_as_integer(xml_doc, "Q6PrevTenure") attributes["prevten"] = unsafe_string_as_integer(xml_doc, "Q6PrevTenure")
attributes["mortlen"] = mortgage_length(xml_doc, attributes) attributes["mortlen"] = mortgage_length(xml_doc, attributes)
attributes["extrabor"] = borrowing(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["wchair"] = unsafe_string_as_integer(xml_doc, "Q15Wheelchair")
attributes["armedforcesspouse"] = unsafe_string_as_integer(xml_doc, "ARMEDFORCESSPOUSE") attributes["armedforcesspouse"] = unsafe_string_as_integer(xml_doc, "ARMEDFORCESSPOUSE")
attributes["hodate"] = compose_date(xml_doc, "HODAY", "HOMONTH", "HOYEAR") attributes["hodate"] = compose_date(xml_doc, "HODAY", "HOMONTH", "HOYEAR")
@ -399,15 +399,6 @@ module Imports
end end
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) def ownership_from_type(attributes)
case attributes["type"] case attributes["type"]
when 2, 24, 18, 16, 28, 31, 30 when 2, 24, 18, 16, 28, 31, 30

Loading…
Cancel
Save