section.rb 363 Bytes
Newer Older
Zac Wood's avatar
Zac Wood committed
1 2 3
# Contains logic belonging to the +Section+ model.
#
# TODO: Add more docs
Zac Wood's avatar
Zac Wood committed
4
class Section < ApplicationRecord
Zac Wood's avatar
Zac Wood committed
5
  # Each +Section+ 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