|
|
|
|
@ -110,10 +110,11 @@ class SurveyResponsesDataLoader
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if row.respondent_type == :parent
|
|
|
|
|
unknown_housing = Housing.find_by(designation: row.housing).id
|
|
|
|
|
parent = Parent.find_or_create_by(response_id: row.response_id, housing_id: unknown_housing)
|
|
|
|
|
parent = Parent.find_or_create_by(response_id: row.response_id)
|
|
|
|
|
parent.number_of_children = row.number_of_children
|
|
|
|
|
tmp_languages = row.languages.map { |language| languages[language] }
|
|
|
|
|
parent.housing_id = Housing.find_by(designation: row.housing).id
|
|
|
|
|
parent.languages.delete_all
|
|
|
|
|
parent.languages.concat(tmp_languages)
|
|
|
|
|
parent.housing = Housing.find_by(designation: row.housing)
|
|
|
|
|
parent.save
|
|
|
|
|
|