From 74ed832b68bf155b1c4324cf599a689664c9626d Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 20 Jan 2017 10:25:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E6=BA=90=E6=A3=80=E7=B4=A2=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E8=BF=81=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/course.rb | 3 ++- db/migrate/20170120021457_os_allow_to_course.rb | 9 +++++++++ db/schema.rb | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20170120021457_os_allow_to_course.rb diff --git a/app/models/course.rb b/app/models/course.rb index f974d0e93..2568c463a 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -99,7 +99,8 @@ class Course < ActiveRecord::Base 'is_delete', 'syllabus_id', 'end_time', - 'end_term' + 'end_term', + 'os_allow' acts_as_customizable diff --git a/db/migrate/20170120021457_os_allow_to_course.rb b/db/migrate/20170120021457_os_allow_to_course.rb new file mode 100644 index 000000000..88ce146e7 --- /dev/null +++ b/db/migrate/20170120021457_os_allow_to_course.rb @@ -0,0 +1,9 @@ +class OsAllowToCourse < ActiveRecord::Migration + def up + courses = Course.where(:tea_id => 193) + courses.update_all(:os_allow => true) + end + + def down + end +end diff --git a/db/schema.rb b/db/schema.rb index 5a73e61b9..f04130f78 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20170119084215) do +ActiveRecord::Schema.define(:version => 20170120021457) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false