|
|
|
|
@ -177,7 +177,7 @@ module DerivedVariables::LettingsLogVariables
|
|
|
|
|
self.la = nil |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
clear_gender_description! if form.start_year_2026_or_later? |
|
|
|
|
clear_gender_description_unless_gender_not_same_as_sex! if form.start_year_2026_or_later? |
|
|
|
|
|
|
|
|
|
set_checkbox_values! |
|
|
|
|
end |
|
|
|
|
@ -420,8 +420,10 @@ private
|
|
|
|
|
return 3 if rent_type == 5 |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def clear_gender_description! |
|
|
|
|
# if gender matching sex not picked as "No, enter gender identity", clear the dependent description field |
|
|
|
|
def clear_gender_description_unless_gender_not_same_as_sex! |
|
|
|
|
# we do this as the gender same as sex page always contains the gender description box that's hidden |
|
|
|
|
# default submit will send a "" for gender description. this ensure it's nil in this case |
|
|
|
|
# as well as blanking it if the user writes it in mistakenly in bulk upload |
|
|
|
|
(1..8).each do |person_index| |
|
|
|
|
gender_same_as_sex = public_send("gender_same_as_sex#{person_index}") |
|
|
|
|
if gender_same_as_sex.present? && gender_same_as_sex != 2 |
|
|
|
|
|