|
|
|
|
@ -248,18 +248,7 @@ private
|
|
|
|
|
self.beds = nil |
|
|
|
|
end |
|
|
|
|
if form.start_year_2026_or_later? |
|
|
|
|
person_count = hhmemb || 8 |
|
|
|
|
(2..person_count).each do |i| |
|
|
|
|
if send("relat#{i}_changed?") && send("relat#{i}_was") == "P" |
|
|
|
|
((i + 1)..person_count).each do |j| |
|
|
|
|
if self["relat#{j}"] == "X" |
|
|
|
|
self["relat#{j}"] = nil |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
else |
|
|
|
|
next |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
reset_partner_fields! |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
@ -330,6 +319,21 @@ private
|
|
|
|
|
unanswered_partner_questions.each { |i| self["relat#{i}"] = "X" } |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def reset_partner_fields! |
|
|
|
|
person_count = hhmemb || 8 |
|
|
|
|
(2..person_count).each do |i| |
|
|
|
|
if send("relat#{i}_changed?") && send("relat#{i}_was") == "P" |
|
|
|
|
((i + 1)..person_count).each do |j| |
|
|
|
|
if self["relat#{j}"] == "X" |
|
|
|
|
self["relat#{j}"] = nil |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
else |
|
|
|
|
next |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def household_type |
|
|
|
|
return unless totelder && totadult && totchild |
|
|
|
|
|
|
|
|
|
|