socialforge/app/models/contestant_for_contest.rb

9 lines
305 B
Ruby
Raw Normal View History

2016-12-22 10:01:37 +08:00
class ContestantForContest < ActiveRecord::Base
belongs_to :contest
attr_accessible :student_id, :contest_id
belongs_to :contestants, :class_name => 'User', :foreign_key => :student_id
validates_presence_of :contest_id, :student_id
validates_uniqueness_of :student_id, :scope => :course_id
end