fix N+1 query in by_event: include user for membership

This commit is contained in:
Justin Edmund 2025-12-04 03:05:53 -08:00
parent d4c88997ff
commit 0a069c0324

View file

@ -34,7 +34,7 @@ module Api
return render json: { gw_event: nil, crew_gw_participation: nil, members_during_event: [] } unless event
participation = @crew.crew_gw_participations
.includes(:gw_event, gw_individual_scores: [:crew_membership, :phantom_player])
.includes(:gw_event, gw_individual_scores: [{ crew_membership: :user }, :phantom_player])
.find_by(gw_event: event)
# Get all members who were active during the event (includes retired members who left after event started)