Add lecture kinds
This commit is contained in:
@@ -3,6 +3,11 @@ class Lecture < ApplicationRecord
|
||||
has_one :attendance
|
||||
has_one :recording
|
||||
|
||||
enum :kind, [
|
||||
:lecture,
|
||||
:problem_class,
|
||||
], default: :lecture
|
||||
|
||||
def week_number
|
||||
((start_time.beginning_of_week - course.semester_start_date.to_time) / 1.week).floor + 1
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user