9 lines
401 B
Ruby
9 lines
401 B
Ruby
class Exercise < ActiveRecord::Base
|
||
#exercise_status: 1,新建;2,发布;3,关闭
|
||
include Redmine::SafeAttributes
|
||
belongs_to :user
|
||
has_many :exercise_questions, :dependent => :destroy,:order => "#{ExerciseQuestion.table_name}.question_number"
|
||
has_many :exercise_users, :dependent => :destroy
|
||
has_many :users, :through => :exercise_users #该测试被哪些用户提交答案过
|
||
end
|