This PR implements the update_cache_from_revisions instance method for CourseUserWikiTimeslice and specs for it.
The behavior for the new method and its specs are based on the update_cache instance method for CoursesUsers.
In addition, this PR implements class method update_all_caches_from_timeslices for CoursesUsers, which involves calculating caches for CoursesUsers records based on the existing timeslices for them.
Finally, it updates the existing UpdateCourseStatsTimeslice class to update caches for CourseUserWikiTimeslice and CoursesUsers. I adds specs for it.
update_cache_from_revisions assumes that revisions are already filtered by that specific course user wiki (similar approach I followed for ArticleCourseWikiTimeslice.update_cache_from_revisions). We could add some checks later.
I had to replace a lot of where queries. We may want to make some performance improvements in the future.
CourseUserWikiTimeslice.total_uploads is not really implemented yet. We're counting all the uploads for the course user in every run (it's not aggregated by wiki/dates).
What this PR does
This PR implements the
update_cache_from_revisions
instance method forCourseUserWikiTimeslice
and specs for it. The behavior for the new method and its specs are based on theupdate_cache
instance method forCoursesUsers
.In addition, this PR implements class method
update_all_caches_from_timeslices
forCoursesUsers
, which involves calculating caches forCoursesUsers
records based on the existing timeslices for them.Finally, it updates the existing
UpdateCourseStatsTimeslice
class to update caches forCourseUserWikiTimeslice
andCoursesUsers
. I adds specs for it.Open questions and concerns
update_cache_from_revisions
assumes that revisions are already filtered by that specific course user wiki (similar approach I followed forArticleCourseWikiTimeslice.update_cache_from_revisions
). We could add some checks later.where
queries. We may want to make some performance improvements in the future.CourseUserWikiTimeslice.total_uploads
is not really implemented yet. We're counting all the uploads for the course user in every run (it's not aggregated by wiki/dates).