From 794fab64df26b1d9f5a5266a1c548c32f339ddad Mon Sep 17 00:00:00 2001 From: Mae Beale Date: Mon, 31 Aug 2026 23:34:03 -0400 Subject: [PATCH] Reduce dev seed volume for workshop logs and monthly reports 89 of each was more than dev needs to exercise the pages; trim to ~18 per user while keeping the varied history and date spacing. Co-Authored-By: Claude Opus 4.8 (1M context) --- db/seeds/dev/monthly_reports.rb | 10 +++++----- db/seeds/dev/workshop_logs.rb | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/db/seeds/dev/monthly_reports.rb b/db/seeds/dev/monthly_reports.rb index 997d15a98c..941d9d98f9 100644 --- a/db/seeds/dev/monthly_reports.rb +++ b/db/seeds/dev/monthly_reports.rb @@ -119,8 +119,8 @@ } if aisha_user - # 30 monthly reports for Aisha (30 months of history) - 30.times do |i| + # A handful of monthly reports for Aisha (recent months of history) + 8.times do |i| create_monthly_report.call( organization: aisha_org, created_by: aisha_user, @@ -128,8 +128,8 @@ ) end - # Additional batches under varying older dates to mimic prod's long tail - report_counts = [ 15, 12, 9, 7, 5, 4, 3, 2, 1, 1 ] + # A few older batches to mimic prod's long tail + report_counts = [ 4, 3, 2, 1 ] report_counts.each_with_index do |count, batch| count.times do |i| create_monthly_report.call( @@ -144,7 +144,7 @@ # A few monthly reports for the admin user as well admin_user = User.first if admin_user && admin_user != aisha_user - 5.times do + 3.times do create_monthly_report.call( organization: Organization.all.sample || aisha_org, created_by: admin_user, diff --git a/db/seeds/dev/workshop_logs.rb b/db/seeds/dev/workshop_logs.rb index fdb38279b9..f77ecbd2e5 100644 --- a/db/seeds/dev/workshop_logs.rb +++ b/db/seeds/dev/workshop_logs.rb @@ -8,9 +8,9 @@ all_workshops = Workshop.all.to_a.shuffle if aisha_user && all_workshops.any? && WorkshopLog.where(created_by_id: aisha_user.id).none? - # 30 logs for Aisha's primary workshop + # A handful of logs for Aisha's primary workshop primary_workshop = all_workshops.shift - 30.times do |i| + 8.times do |i| WorkshopLog.create!( workshop_id: primary_workshop.id, organization_id: aisha_org.id, @@ -28,9 +28,9 @@ ) end - # Up to 10 other workshops with varying log counts (1–15) - other_workshops = all_workshops.first(10) - log_counts = [ 15, 12, 9, 7, 5, 4, 3, 2, 1, 1 ] + # A few other workshops with varying log counts + other_workshops = all_workshops.first(4) + log_counts = [ 4, 3, 2, 1 ] other_workshops.each_with_index do |workshop, idx| count = log_counts[idx] || 1 count.times do |i| @@ -51,12 +51,12 @@ ) end end - puts " Created 89 logs for Aisha on 11 workshops" + puts " Created #{WorkshopLog.where(created_by_id: aisha_user.id).count} logs for Aisha on #{other_workshops.count + 1} workshops" end # A few logs for the admin user as well if WorkshopLog.where(created_by_id: User.first&.id).none? - 5.times do + 3.times do workshop = Workshop.all.sample next unless workshop