From 2b06e70302a0e8ad0859d0c5a49dfe50c8207069 Mon Sep 17 00:00:00 2001 From: kosiakkatrina <54268893+kosiakkatrina@users.noreply.github.com> Date: Thu, 8 Sep 2022 09:12:30 +0100 Subject: [PATCH] set housingneeds_type to none of the above if no housingneeds selected (#857) --- app/services/imports/lettings_logs_import_service.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/services/imports/lettings_logs_import_service.rb b/app/services/imports/lettings_logs_import_service.rb index 972f15f26..97be11dc2 100644 --- a/app/services/imports/lettings_logs_import_service.rb +++ b/app/services/imports/lettings_logs_import_service.rb @@ -113,6 +113,7 @@ module Imports attributes["housingneeds_type"] = 0 if attributes["housingneeds_a"] == 1 attributes["housingneeds_type"] = 1 if attributes["housingneeds_b"] == 1 attributes["housingneeds_type"] = 2 if attributes["housingneeds_c"] == 1 + attributes["housingneeds_type"] = 3 if attributes["housingneeds_f"] == 1 && [attributes["housingneeds_a"], attributes["housingneeds_b"], attributes["housingneeds_c"]].all? { |housingneed| housingneed != 1 } attributes["housingneeds_other"] = attributes["housingneeds_f"] == 1 ? 1 : 0 attributes["illness"] = unsafe_string_as_integer(xml_doc, "Q10ia")