|
|
|
|
@ -276,12 +276,12 @@ private
|
|
|
|
|
|
|
|
|
|
def clear_child_constraints_for_age_changes! |
|
|
|
|
(2..8).each do |idx| |
|
|
|
|
if public_send("age#{idx}_changed?") |
|
|
|
|
self["ecstat#{idx}"] = nil if self["ecstat#{idx}"] == 9 |
|
|
|
|
# since the user can also input 'No' for relat there are cases when we don't want to clear this (changing age from 50 to 55 for example) |
|
|
|
|
# note if age is changed from 10 to 15 we will clear it but the inference will set it back immediately after, see child_under_16_constraints! |
|
|
|
|
self["relat#{idx}"] = nil if self["relat#{idx}"] == "X" && age_changed_from_below_16(idx) && form.start_year_2026_or_later? |
|
|
|
|
end |
|
|
|
|
next unless public_send("age#{idx}_changed?") |
|
|
|
|
|
|
|
|
|
self["ecstat#{idx}"] = nil if self["ecstat#{idx}"] == 9 |
|
|
|
|
# since the user can also input 'No' for relat there are cases when we don't want to clear this (changing age from 50 to 55 for example) |
|
|
|
|
# note if age is changed from 10 to 15 we will clear it but the inference will set it back immediately after, see child_under_16_constraints! |
|
|
|
|
self["relat#{idx}"] = nil if self["relat#{idx}"] == "X" && age_changed_from_below_16(idx) && form.start_year_2026_or_later? |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|