class MigrateCourseSecondCategoryUserId < ActiveRecord::Migration[5.2]
  def change
    CourseSecondCategory.includes(:course).each do |category|
      category.update!(user_id: category.course&.tea_id)
    end
  end
end
