Skip to content

Commit

Permalink
Fix minor bug in RevisionStatTimeslice. Currently REVISION_TIMEFRAME …
Browse files Browse the repository at this point in the history
…is set to 7 days. If the course start is less that one week ago, we don't want to try to retrieve a timeslice for 7 days ago because that timeslice won't exist. Because of that, now we fix the start period for the timeframe as the max between course start or 7 days ago. (#6186)
  • Loading branch information
gabina authored Feb 10, 2025
1 parent 700dd69 commit 08b4e0d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/revision_stat_timeslice.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class RevisionStatTimeslice
def initialize(course, end_period = Time.zone.now)
@course = course
@end_period = end_period
@start_period = REVISION_TIMEFRAME.days.ago
@start_period = [REVISION_TIMEFRAME.days.ago, course.start].max
end

def recent_revisions_for_course
Expand Down

0 comments on commit 08b4e0d

Please sign in to comment.