trustieforge/app/models/exercise.rb

8 lines
346 B
Ruby
Raw Normal View History

class Exercise < ActiveRecord::Base
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