← All updates

More accurate team totals, DQ scoring and one made-cut rule

Reliability
Date:
2026-12-02
Changes:
78c8d25 · 1 commit

Why it matters: Players see team totals that include every golfer's latest score, and a team's made-cut status follows the same rule wherever scores are updated.

We fixed and tightened how team scores are worked out during a tournament:

  • Team totals are up to date. A team’s total now includes each golfer’s newest score. Before, totals could lag one golfer behind after each score update.
  • Disqualified golfers are scored like withdrawals. A golfer who is disqualified now counts the same way as one who withdraws. The leaderboard labels them DQ, and the help pages explain this.
  • One made-cut rule. A team is out once any of its golfers is out. The same rule now applies to automatic score updates, the cut line and manual score corrections. It never brings a team that is out back in.

Score updates are also more careful. If the scores page can’t be read, the update is marked as failed. If some golfers are skipped, for example because their names can’t be matched, the update shows a warning to site administrators.

Under the hood: Each update now fetches and reads the scores before it changes any saved data. All three places that decide the cut now use one shared check.

Commits (1)
  • 78c8d25 Scoring decisions (phase 4): correct team totals, DQ scored like WD, red/amber scrapes, one made-cut rule
Files Changed (28)
app/controllers/admin/events_controller.rb         | 70 ++--------------------
app/controllers/admin/golfer_results_controller.rb | 43 +-------------
app/helpers/golfers_helper.rb                      | 14 +++---
app/jobs/score_scrape_job.rb                       |  6 +-
app/models/scrape.rb                               | 32 ++++++++++
app/models/tournament_team_score.rb                |  6 ++-
app/services/score_update_service.rb               | 69 +++++++++++++++++++----
app/services/team_cut.rb                           | 25 ++++++++
app/services/tournament_scraper_service.rb         | 80 +++++++++++++++++++++-----
app/views/admin/dashboard/show.html.erb            |  8 +++
app/views/admin/events/_activity_feed.html.erb     |  7 ++-
.../admin/events/_score_updater_card.html.erb      | 14 +++++-
app/views/admin/events/run_updater.html.erb        |  8 +++
app/views/golfers/_mobile_leaderboard.html.erb     |  4 +-
app/views/help/pages/how_scoring_works.html.erb    |  2 +-
.../pages/understanding_tournament_play.html.erb   |  2 +-
.../1203000000_add_notes_and_warning_to_scrapes.rb |  9 +++
db/schema.rb                                       |  4 +-
docs/background_jobs.md                            | 33 ++++++-----
docs/background_scraper.md                         | 34 +++++++++++-
test/controllers/admin/events_coverage_test.rb     | 87 ++++++++++++++++++++++------
test/fixtures/files/espn/leaderboard.html          |  3 +-
test/helpers/golfers_helper_test.rb                | 27 +++++++++
test/jobs/score_scrape_job_test.rb                 | 62 +++++++++++++++++++-
test/models/tournament_team_score_test.rb          | 10 ++--
test/services/score_update_service_test.rb         | 96 ++++++++++++++++++++++++++-----
test/services/team_cut_test.rb                     | 60 +++++++++++++++++++
test/services/tournament_scraper_service_test.rb   | 93 +++++++++++++++++++++---------
28 files changed, 677 insertions(+), 231 deletions(-)

← All updates