Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/controllers/feedback_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ def feedback_params
end

def set_coaches(workshop)
@coaches = workshop.invitations.to_coaches.accepted_or_attended
@coaches = workshop.invitations.to_coaches
.where('attending IS NULL OR attending = ? OR attended = ?', true, true)
.order(Arel.sql('attended DESC NULLS LAST'))
.map(&:member)
end
Expand Down
19 changes: 19 additions & 0 deletions spec/features/member_feedback_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,25 @@
expect(page).to have_select('feedback_coach_id', with_options: [coach_not_yet_verified.full_name])
end

scenario 'I can see coaches who were invited but never RSVPed (Issue #2633)' do
# This reproduces the real-world scenario where:
# 1. Coach is invited to workshop but never responds (attending = nil)
# 2. Coach shows up anyway
# 3. Organizer hasn't yet marked attendance (attended = nil)
# 4. Student receives feedback form and should still be able to select the coach
walk_in_coach = Fabricate(:coach)
Fabricate(:coach_workshop_invitation,
workshop: feedback_request.workshop,
member: walk_in_coach,
attending: nil,
attended: nil)

visit feedback_path(valid_token)

# Coach should appear in the list even though they never RSVPed
expect(page).to have_select('feedback_coach_id', with_options: [walk_in_coach.full_name])
end

scenario 'verified coaches appear before unverified coaches in the list' do
# Create two coaches: one verified (attended=true), one not yet (attended=nil)
verified_coach = Fabricate(:coach, name: 'Alice', surname: 'Verified')
Expand Down