Skip to content

Fix: Use sponsor capacity for in-person workshop attendance checks#2611

Merged
mroderick merged 1 commit intocodebar:masterfrom
mroderick:fix/workshop-capacity-sponsor-check
May 6, 2026
Merged

Fix: Use sponsor capacity for in-person workshop attendance checks#2611
mroderick merged 1 commit intocodebar:masterfrom
mroderick:fix/workshop-capacity-sponsor-check

Conversation

@mroderick
Copy link
Copy Markdown
Collaborator

Summary

This PR fixes a bug introduced in #2609 where in-person workshops incorrectly appear as full even when the sponsor has available capacity.

Problem

PR #2609 changed WorkshopPresenter#event_student_spaces? and event_coach_spaces? to use model.student_spaces and model.coach_spaces (database columns). However, most in-person workshops in production have these values set to 0, with actual capacity coming from the sponsor/venue:

workshop.student_spaces = 0
workshop.coach_spaces = 0
sponsor.seats = 20
sponsor.number_of_coaches = 20

This caused workshops like Barcelona #3747 to show "The workshop is full" when there were actually 20 student spots and 20 coach spots available.

Solution

Changed the capacity check methods to use the presenter methods student_spaces and coach_spaces instead of the database columns directly:

def event_student_spaces?
  student_spaces > attending_students.length
end

def event_coach_spaces?
  coach_spaces > attending_coaches.length
end

This ensures:

  • In-person workshops: Use venue.seats and venue.coach_spots (sponsor capacity)
  • Virtual workshops: Use model.student_spaces and model.coach_spaces (via VirtualWorkshopPresenter delegation)

Testing

  • Added test cases for the production data scenario (workshop spaces = 0, sponsor has capacity)
  • Updated feature tests to properly fill workshops to capacity
  • All 82 presenter tests pass
  • All 39 invitation feature tests pass

Affected Workflows

This fixes the issue where:

  • Invites go out
  • Invitation page says "The workshop is full"
  • RSVP adds user to waiting list even though spots are available

As reported for Barcelona and Berlin workshops.

PR codebar#2609 changed WorkshopPresenter to use model.student_spaces and
model.coach_spaces for capacity checks, but this broke in-person
workshops that rely on sponsor capacity.

Most in-person workshops have student_spaces=0 and coach_spaces=0 in
the database, with actual capacity coming from the sponsor/venue.

This fix changes event_student_spaces? and event_coach_spaces? to use
the presenter methods student_spaces and coach_spaces, which delegate
to the sponsor for in-person workshops.

- In-person workshops: use venue.seats and venue.coach_spots
- Virtual workshops: use model.student_spaces and model.coach_spaces

Fixes: Workshops incorrectly showing as full when sponsor has capacity
@mroderick mroderick requested a review from KimberleyCook May 6, 2026 11:15
@mroderick mroderick marked this pull request as ready for review May 6, 2026 11:15
@mroderick mroderick merged commit e764d98 into codebar:master May 6, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants