Select the previous week when passing a sunday

This commit is contained in:
Jorge Manrubia
2025-09-23 14:02:29 +02:00
parent c2858c82da
commit e8f6323cf0
+1
View File
@@ -15,6 +15,7 @@ module User::Highlights
def generate_weekly_highlights(date = Time.current)
in_time_zone do
date = date - 1.day if date.sunday?
PeriodHighlights.create_or_find_for collections, starts_at: highlights_starts_at(date), duration: 1.week
end
end