Fix bug.
This commit is contained in:
parent
42569fd0b7
commit
9eb64bb6a5
|
@ -6,7 +6,6 @@ Rails.application.routes.draw do
|
||||||
surveys.each do |survey|
|
surveys.each do |survey|
|
||||||
group_data = survey.survey_answers.asc(:updated_at).group_by(&:user)
|
group_data = survey.survey_answers.asc(:updated_at).group_by(&:user)
|
||||||
group_data.each do |user_id,survey_answers|
|
group_data.each do |user_id,survey_answers|
|
||||||
org_updated_at = survey_answers.map{|a| a.updated_at}
|
|
||||||
if user_id.blank?
|
if user_id.blank?
|
||||||
survey_answers.each do |survey_answer|
|
survey_answers.each do |survey_answer|
|
||||||
info = {:questionnaire_survey_id=>survey.id,:user=>user_id,:survey_answer_ids=>[survey_answer.id]}
|
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.survey_answer_ids = survey_answers.map{|a| a.id}
|
||||||
answer_group.save
|
answer_group.save
|
||||||
end
|
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
|
end
|
||||||
survey.already_fix_data = true
|
survey.already_fix_data = true
|
||||||
survey.survey_questions.each do |q|
|
survey.survey_questions.each do |q|
|
||||||
|
|
Loading…
Reference in New Issue