9 lines
305 B
Ruby
9 lines
305 B
Ruby
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
|