← All updates

Hosts can delete or archive a group

Feature
Date:
2026-11-29
Changes:
22b8755…4049266 · 4 commits

Why it matters: Hosts can tidy up old pools without losing a group's history by accident.

  • A group that only its host ever joined can be deleted right away.
  • Any other group is archived: it’s hidden from every member, and the host can restore it for 30 days.
  • Nothing can be deleted or archived while a tournament is live, so standings are never lost mid-event.
  • Archived groups don’t count toward the 3-group limit.
Commits (4)
  • 22b8755 The host can't remove their own primary-admin row
  • 40d6dda Hosts can delete or archive a group (30-day restore)
  • a355dd4 Group removal: close the audit's gaps
  • 4049266 Removals lock the event first, so they can't deadlock with transitions
Files Changed (43)
.../admin/archived_groups_controller.rb          |  20 ++
app/controllers/admin/event_emails_controller.rb |   2 +-
app/controllers/admin/group_emails_controller.rb |   4 +-
app/controllers/application_controller.rb        |   2 +-
app/controllers/concerns/require_live_group.rb   |  20 ++
app/controllers/entrant_groups_controller.rb     |   3 +
.../group_admin/handicaps_controller.rb          |   6 +-
app/controllers/group_admin_controller.rb        |  14 +-
app/controllers/groups_controller.rb             | 136 ++++++++--
app/controllers/message_reactions_controller.rb  |   3 +
app/controllers/messages_controller.rb           |   4 +
app/jobs/purge_archived_groups_job.rb            |  29 ++
app/models/global_pool_cache.rb                  |  18 ++
app/models/group.rb                              | 164 ++++++++---
app/models/historical_tournament_score.rb        |   2 +-
app/models/user.rb                               |  15 +-
app/services/group_removal.rb                    | 142 +++++++++-
app/services/tournament_state_service.rb         |   5 +-
app/services/user_tournament_stats_service.rb    |   2 +-
app/views/admin/archived_groups/index.html.erb   |  43 +++
app/views/admin/dashboard/show.html.erb          |  14 +
.../email_confirmations/_required_card.html.erb  |   3 +
app/views/group_admin/_remove_group.html.erb     |  40 +++
app/views/group_admin/show.html.erb              |   5 +-
app/views/groups/_live_team_row.html.erb         |   2 +-
app/views/groups/_teams.html.erb                 |   2 +-
app/views/groups/new.html.erb                    |   3 +-
app/views/layouts/_groups_nav.html.erb           |   3 +
app/views/layouts/eom_v3.html.erb                |   3 +
app/views/shared/_archived_groups_card.html.erb  |  25 ++
app/views/teams/_historical_team_row.html.erb    |   2 +-
app/views/teams/_my_teams.html.erb               |   6 +-
app/views/user_profiles/show.html.erb            |   1 +
config/initializers/mail_delivery_job.rb         |   6 +
config/recurring.yml                             |   8 +
config/routes.rb                                 |   5 +
.../20261130200000_add_archived_at_to_groups.rb  |  11 +
db/schema.rb                                     |   7 +-
test/controllers/group_archive_test.rb           | 477 ++++++++++++++++++++++++++++++-
test/controllers/groups_controller_test.rb       |  39 +++-
test/models/group_removal_race_test.rb           | 233 +++++++++++++++-
test/models/group_test.rb                        |   4 +
test/services/tournament_state_service_test.rb   |  29 ++
43 files changed, 1458 insertions(+), 104 deletions(-)

← All updates