Modified code to remove 'status' field from lecture's table and added 'event_uuid' field. Also refined the 'start_time' field in recordings' table to handle datetime instead of strings. Further, made minor changes in scraping jobs and seeding logic. Implemented these changes to allow lectures to be associated with calendar events and streamlined various fields.
14 lines
275 B
Ruby
14 lines
275 B
Ruby
class Lecture < ApplicationRecord
|
|
belongs_to :course
|
|
has_one :attendance
|
|
belongs_to :recording, optional: true
|
|
|
|
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
|