|
|
|
@ -75,7 +75,7 @@ module DerivedVariables::LettingsLogVariables |
|
|
|
self.beds = nil |
|
|
|
self.beds = nil |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
clear_child_ecstat_for_age_changes! |
|
|
|
clear_child_constraints_for_age_changes! |
|
|
|
child_under_16_constraints! |
|
|
|
child_under_16_constraints! |
|
|
|
|
|
|
|
|
|
|
|
self.hhtype = household_type |
|
|
|
self.hhtype = household_type |
|
|
|
@ -269,14 +269,16 @@ private |
|
|
|
(2..8).each do |idx| |
|
|
|
(2..8).each do |idx| |
|
|
|
if age_under_16?(idx) |
|
|
|
if age_under_16?(idx) |
|
|
|
self["ecstat#{idx}"] = 9 |
|
|
|
self["ecstat#{idx}"] = 9 |
|
|
|
|
|
|
|
self["relat#{idx}"] = "X" if form.start_year_2026_or_later? |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def clear_child_ecstat_for_age_changes! |
|
|
|
def clear_child_constraints_for_age_changes! |
|
|
|
(2..8).each do |idx| |
|
|
|
(2..8).each do |idx| |
|
|
|
if public_send("age#{idx}_changed?") && self["ecstat#{idx}"] == 9 |
|
|
|
if public_send("age#{idx}_changed?") |
|
|
|
self["ecstat#{idx}"] = nil |
|
|
|
self["ecstat#{idx}"] = nil if self["ecstat#{idx}"] == 9 |
|
|
|
|
|
|
|
self["relat#{idx}"] = nil if self["relat#{idx}"] == "X" && form.start_year_2026_or_later? |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|