Browse Source

Only set all housing needs values to 1 if there are no housingneeds

pull/826/head
Kat 3 years ago committed by Kat
parent
commit
1259426390
  1. 14
      app/models/derived_variables/case_log_variables.rb

14
app/models/derived_variables/case_log_variables.rb

@ -189,15 +189,13 @@ private
end end
def set_housingneeds_fields def set_housingneeds_fields
set_housingneeds_values_to_zero self.housingneeds_a = fully_wheelchair_accessible? ? 1 : 0
self.housingneeds_b = essential_wheelchair_access? ? 1 : 0
self.housingneeds_a = 1 if fully_wheelchair_accessible? self.housingneeds_c = level_access_housing? ? 1 : 0
self.housingneeds_b = 1 if essential_wheelchair_access? self.housingneeds_f = other_housingneeds? ? 1 : 0
self.housingneeds_c = 1 if level_access_housing?
self.housingneeds_f = 1 if other_housingneeds?
set_housingneeds_values_to_zero unless has_housingneeds? set_housingneeds_values_to_zero unless has_housingneeds?
self.housingneeds_g = 1 if no_housingneeds? self.housingneeds_g = no_housingneeds? ? 1 : 0
self.housingneeds_h = 1 if unknown_housingneeds? self.housingneeds_h = unknown_housingneeds? ? 1 : 0
end end
def set_housingneeds_values_to_zero def set_housingneeds_values_to_zero

Loading…
Cancel
Save