course revert search project
This commit is contained in:
parent
5a5db45af2
commit
19aba25625
|
@ -2,7 +2,7 @@ class Course < ActiveRecord::Base
|
||||||
include Redmine::SafeAttributes
|
include Redmine::SafeAttributes
|
||||||
|
|
||||||
attr_accessible :code, :extra, :name, :state, :tea_id, :time , :location, :state, :term, :password
|
attr_accessible :code, :extra, :name, :state, :tea_id, :time , :location, :state, :term, :password
|
||||||
belongs_to :project, :class_name => 'Project', :foreign_key => :extra # 定义一个project方法, 该方法通过extra来调用project表
|
belongs_to :project, :class_name => 'Project', :foreign_key => :extra, primary_key: :identifier
|
||||||
belongs_to :teacher, :class_name => 'User', :foreign_key => :tea_id # 定义一个方法teacher,该方法通过tea_id来调用User表
|
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表
|
belongs_to :school, :class_name => 'School', :foreign_key => :school_id #定义一个方法school,该方法通过school_id来调用School表
|
||||||
has_many :bid
|
has_many :bid
|
||||||
|
|
|
@ -18,6 +18,11 @@
|
||||||
require "digest/sha1"
|
require "digest/sha1"
|
||||||
|
|
||||||
class User < Principal
|
class User < Principal
|
||||||
|
TEACHER = 0
|
||||||
|
STUDENT = 1
|
||||||
|
ENTERPRISE = 2
|
||||||
|
DEVELOPER = 3
|
||||||
|
|
||||||
include Redmine::SafeAttributes
|
include Redmine::SafeAttributes
|
||||||
|
|
||||||
# Different ways of displaying/sorting users
|
# Different ways of displaying/sorting users
|
||||||
|
|
Loading…
Reference in New Issue