Add functionality to set default live video URL
Build and Publish Docker Container / build (push) Successful in 6m21s

A new method has been added to the `CoursesController` which allows admins to fill default live video URLs for online lectures that don't have one. This feature is accessible via a button on the courses admin page. The routing for this new action has also been set up.
This commit is contained in:
2024-02-04 15:14:38 +00:00
parent c97041597b
commit f81005408e
4 changed files with 15 additions and 4 deletions
+1 -1
View File
@@ -87,6 +87,6 @@ class Course < ApplicationRecord
def fill_in_default_live_video_url!
raise "No default live video URL set" if self.default_live_video_url.nil?
lectures.where(live_video_url: nil).update_all!(live_video_url: self.default_live_video_url)
lectures.where(live_video_url: nil).update_all(live_video_url: self.default_live_video_url)
end
end