Allow for scraping toggl entries for specific courses only, change default to be active courses and add a new action to allow manual re-scraping in the case of errors.
Build and Publish Docker Container / build (push) Successful in 5m49s
Build and Publish Docker Container / build (push) Successful in 5m49s
This commit is contained in:
@@ -89,4 +89,11 @@ class Course < ApplicationRecord
|
||||
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)
|
||||
end
|
||||
|
||||
# Sometimes our toggl entries get mismatched or otherwise out of sync. This method will delete all tracked time entries
|
||||
# for this course and then re-import them from Toggl.
|
||||
def redo_toggl_entries!
|
||||
TrackedTimeEntry.where(lecture: lectures).destroy_all
|
||||
ScrapeTogglJob.perform_later([self.id])
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user