semester.rb 344 Bytes
Newer Older
Zac Wood's avatar
Zac Wood committed
1 2 3
# Contains logic having to do with the +Semester+ model.
#
# A +Semester+ is a simple model that consists of a +year+ and a +season+, e.g. "Fall 2018".
Zac Wood's avatar
Zac Wood committed
4
class Semester < ApplicationRecord
5
  has_many :courses
6
  has_many :closures
Zac Wood's avatar
Zac Wood committed
7

Zac Wood's avatar
Zac Wood committed
8 9 10
  # Ensure necessary fields are present.
  validates :year, presence: true
  validates :season, presence: true
Zac Wood's avatar
Zac Wood committed
11
end