diff --git a/config/routes.rb b/config/routes.rb index 4c4d266..39201ba 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -6,7 +6,6 @@ Rails.application.routes.draw do surveys.each do |survey| group_data = survey.survey_answers.asc(:updated_at).group_by(&:user) group_data.each do |user_id,survey_answers| - org_updated_at = survey_answers.map{|a| a.updated_at} if user_id.blank? survey_answers.each do |survey_answer| info = {:questionnaire_survey_id=>survey.id,:user=>user_id,:survey_answer_ids=>[survey_answer.id]} @@ -29,7 +28,7 @@ Rails.application.routes.draw do answer_group.survey_answer_ids = survey_answers.map{|a| a.id} answer_group.save end - survey_answers.each_with_index{|a,i| a.updated_at = org_updated_at[i];a.save} + survey_answers.each_with_index{|a,i| a.updated_at = a.created_at;a.save} end survey.already_fix_data = true survey.survey_questions.each do |q|