PENGZhaoqing / CourseSelect

校园选课系统样本 (a template for course selection system by Ruby on Rails)
https://courseselect.herokuapp.com/
MIT License
105 stars 205 forks source link

#26 号 帖子的继续讨论请归并 #41

Closed tangmaomao16 closed 8 years ago

tangmaomao16 commented 8 years ago

@PENGZhaoqing @jewhau jewhau 的代码是: class AddOpenAttribute < ActiveRecord::Migration add_column :courses, :course_open, :boolean, :default =>false end

我想问, (1)我将第二行的courses删去,直接写open,如下: add_column :open, :boolean, :default =>false 我这样做,行不行?

(2)另外,如果保留courses, 但是后面的不用:course_open,而直接写:open, 即 add_column :courses, :open, :boolean, :default =>false 这样行不行?

(3)其实我不是很明白add_column的具体含义。