You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
trustieforge/app/models/students_for_course.rb

11 lines
357 B

class StudentsForCourse < ActiveRecord::Base
attr_accessible :course_id, :student_id
belongs_to :course, :class_name => 'Project', :foreign_key => :course_id
belongs_to :student, :class_name => 'User', :foreign_key => :student_id
validates_presence_of :course_id, :student_id
validates_uniqueness_of :student_id, :scope => :course_id
end