From 7d1a7b77b9f856d97c7c3b2ec8c3063db1bd31df Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 15 Aug 2019 14:55:16 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=81=E7=A7=BB=E8=AF=BE=E7=A8=8B=E6=80=BB?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E9=95=BF=E7=9A=84=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/migrate/20190815064541_modify_class_period_for_courses.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/db/migrate/20190815064541_modify_class_period_for_courses.rb b/db/migrate/20190815064541_modify_class_period_for_courses.rb index 00f030ce4..855dc0db2 100644 --- a/db/migrate/20190815064541_modify_class_period_for_courses.rb +++ b/db/migrate/20190815064541_modify_class_period_for_courses.rb @@ -1,5 +1,8 @@ class ModifyClassPeriodForCourses < ActiveRecord::Migration[5.2] def change + Course.find_each do |c| + c.update_column(:class_period, c.class_period.to_i) + end change_column :courses, :class_period, :integer, :default => 0 end end