Select the previous week when passing a sunday
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user