From 85b7a4fb67cb5e8d1ddf60f13d2bb43aa76c1609 Mon Sep 17 00:00:00 2001 From: Kat Date: Tue, 12 Jul 2022 16:18:58 +0100 Subject: [PATCH] remove inferring builtype --- app/models/derived_variables/case_log_variables.rb | 1 - spec/models/case_log_spec.rb | 5 ----- 2 files changed, 6 deletions(-) diff --git a/app/models/derived_variables/case_log_variables.rb b/app/models/derived_variables/case_log_variables.rb index 1d1694365..8a8d8429a 100644 --- a/app/models/derived_variables/case_log_variables.rb +++ b/app/models/derived_variables/case_log_variables.rb @@ -75,7 +75,6 @@ module DerivedVariables::CaseLogVariables if location self.la = location.county self.postcode_full = location.postcode - self.builtype = form.questions.find { |x| x.id == "builtype" }.answer_options.find { |_key, value| value["value"] == location.type_of_building }.first wheelchair_adaptation_map = { 1 => 1, 0 => 2 } self.wchair = wheelchair_adaptation_map[location.wheelchair_adaptation.to_i] end diff --git a/spec/models/case_log_spec.rb b/spec/models/case_log_spec.rb index f697b0447..d5cbed1cc 100644 --- a/spec/models/case_log_spec.rb +++ b/spec/models/case_log_spec.rb @@ -1730,11 +1730,6 @@ RSpec.describe CaseLog do expect(supported_housing_case_log.unittype_sh).to eq(1) end - it "correctly infers and saves type of building" do - record_from_db = ActiveRecord::Base.connection.execute("SELECT builtype from case_logs WHERE id=#{supported_housing_case_log.id}").to_a[0] - expect(record_from_db["builtype"]).to eq(1) - end - it "correctly infers and saves wchair" do record_from_db = ActiveRecord::Base.connection.execute("SELECT wchair from case_logs WHERE id=#{supported_housing_case_log.id}").to_a[0] expect(record_from_db["wchair"]).to eq(2)