Add a new join model to link summaries with users

So that changing the set of events does not result in not being able to find a generated highlight summary
This commit is contained in:
Jorge Manrubia
2025-10-06 12:00:49 +02:00
parent 5340f73bbb
commit 3e67da7d0e
8 changed files with 141 additions and 13 deletions
@@ -2,11 +2,12 @@
require_relative "../config/environment"
WEEKS_TO_BACKFILL = 10
WEEKS_TO_BACKFILL = 3
ActiveRecord::Base.logger = Logger.new(File::NULL)
ApplicationRecord.with_each_tenant do |tenant|
PeriodHighlights.destroy_all
WEEKS_TO_BACKFILL.times do |index|
User.active.find_each do |user|
user.generate_weekly_highlights(Time.current - index.weeks)