26 lines
465 B
Ruby
26 lines
465 B
Ruby
class Lecture < ApplicationRecord
|
|
belongs_to :course
|
|
|
|
enum :status, [
|
|
:future,
|
|
:happening_now,
|
|
:attended_in_person,
|
|
:watched_recording,
|
|
:missed,
|
|
]
|
|
|
|
def week_number
|
|
((start_time.beginning_of_week - Time.new('2023-10-02')) / 1.week).floor
|
|
end
|
|
|
|
def live_video_url
|
|
nil
|
|
end
|
|
|
|
def recording_url
|
|
return nil if recording_id.nil?
|
|
|
|
"https://uniofbath.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=#{recording_id}"
|
|
end
|
|
end
|