|
|
|
@ -5,7 +5,7 @@ class Course < ActiveRecord::Base
|
|
|
|
|
STATUS_CLOSED = 5
|
|
|
|
|
STATUS_ARCHIVED = 9
|
|
|
|
|
|
|
|
|
|
attr_accessible :code, :extra, :name, :state, :tea_id, :time , :location, :state, :term, :password,:is_public,:description,:class_period
|
|
|
|
|
attr_accessible :code, :extra, :name, :state, :tea_id, :time , :location, :state, :term, :password,:is_public,:description,:class_period, :open_student
|
|
|
|
|
belongs_to :project, :class_name => 'Course', :foreign_key => :extra, primary_key: :identifier
|
|
|
|
|
belongs_to :teacher, :class_name => 'User', :foreign_key => :tea_id # 定义一个方法teacher,该方法通过tea_id来调用User表
|
|
|
|
|
belongs_to :school, :class_name => 'School', :foreign_key => :school_id #定义一个方法school,该方法通过school_id来调用School表
|
|
|
|
@ -52,7 +52,8 @@ class Course < ActiveRecord::Base
|
|
|
|
|
'term',
|
|
|
|
|
'is_public',
|
|
|
|
|
'description',
|
|
|
|
|
'class_period'
|
|
|
|
|
'class_period',
|
|
|
|
|
'open_student'
|
|
|
|
|
|
|
|
|
|
acts_as_customizable
|
|
|
|
|
|
|
|
|
|