dev_tj
cxt 5 years ago
parent 29161608b1
commit 75f892f1bd

@ -1,6 +1,6 @@
class AddChoiceIndexToExerciseAnswers < ActiveRecord::Migration[5.2] class AddChoiceIndexToExerciseAnswers < ActiveRecord::Migration[5.2]
def change def change
# add_column :exercise_answers, :choice_index, :integer, default: 1 add_column :exercise_answers, :choice_index, :integer, default: 1
multi_questions = ExerciseQuestion.where(question_type: 1) multi_questions = ExerciseQuestion.where(question_type: 1)
multi_questions.includes(:exercise_choices, :exercise_answers).find_each do |question| multi_questions.includes(:exercise_choices, :exercise_answers).find_each do |question|

Loading…
Cancel
Save