Continue adding problem sheets
This commit is contained in:
@@ -12,7 +12,7 @@ class ScrapeTogglJob < ApplicationJob
|
||||
# @param [Course] course
|
||||
def scrape_course(course)
|
||||
toggl_project_id = course.toggl_project
|
||||
lectures = course.lectures.order(:start_time).includes(:attendance)
|
||||
lectures = course.lectures.order(:start_time).includes(:tracked_time_entries)
|
||||
|
||||
return if lectures.empty?
|
||||
|
||||
@@ -52,6 +52,12 @@ class ScrapeTogglJob < ApplicationJob
|
||||
# TODO: What should happen if the time entry is materially before the lecture?
|
||||
kind:
|
||||
) and next
|
||||
elsif (work_item = course.work_items.find_by(title: entry_title))
|
||||
work_item.tracked_time_entries.create!(
|
||||
toggl_data: entry,
|
||||
associated_toggl_entry_id: entry['time_entries'][0]['id'],
|
||||
kind: :generic
|
||||
) and next
|
||||
end
|
||||
|
||||
concurrent_unlabeled = entry['time_entries'].any? do |inner_entry|
|
||||
|
||||
Reference in New Issue
Block a user