app/commands/decidim/forms/admin/update_questionnaire.rb in decidim-forms-0.21.0 vs app/commands/decidim/forms/admin/update_questionnaire.rb in decidim-forms-0.22.0
- old
+ new
@@ -54,9 +54,17 @@
free_text: form_answer_option.free_text
}
update_nested_model(form_answer_option, answer_option_attributes, question.answer_options)
end
+
+ form_question.matrix_rows.each do |form_matrix_row|
+ matrix_row_attributes = {
+ body: form_matrix_row.body
+ }
+
+ update_nested_model(form_matrix_row, matrix_row_attributes, question.matrix_rows)
+ end
end
end
def update_nested_model(form, attributes, parent_association)
record = parent_association.find_by(id: form.id) || parent_association.build(attributes)