19 lines
372 B
Ruby
19 lines
372 B
Ruby
class Lecture < ApplicationRecord
|
|
belongs_to :course
|
|
has_one :attendance, dependent: :destroy
|
|
has_one :recording, dependent: :nullify
|
|
|
|
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
|
|
|
|
def live_video_url
|
|
nil
|
|
end
|
|
end
|