course_section.rb 381 Bytes
Newer Older
Zac Wood's avatar
Zac Wood committed
1
# Contains logic belonging to the +CourseSection+ model.
Zac Wood's avatar
Zac Wood committed
2
3
#
# TODO: Add more docs
Zac Wood's avatar
Zac Wood committed
4
5
class CourseSection < ApplicationRecord
  # Each +CourseSection+ belongs to a +Course+.
Zac Wood's avatar
Zac Wood committed
6
  belongs_to :course
Zac Wood's avatar
Zac Wood committed
7
8
9
10
11

  # Ensure all necessary fields are present.
  validates :name, presence: true
  validates :crn, presence: true
  validates :title, presence: true
12
  validates :course_id, presence: true
Zac Wood's avatar
Zac Wood committed
13
end