More nil answers

This commit is contained in:
Linus Gasser 2025-10-20 11:36:22 +02:00
parent f7768bd1f8
commit 8ae9bf2e54
3 changed files with 3 additions and 3 deletions

View file

@ -20,7 +20,7 @@ prawn_document(force_download: true, filename: @pdf_filename, page_layout: :land
@conference.questions.each do |question|
qa = registration.qanswers.find_by(question: question)
answer = ( qa ? qa.answer.title : '' )
answer = qa&.answer&.title || ''
row << answer
end

View file

@ -21,7 +21,7 @@ wb.add_worksheet(name: 'registrations') do |sheet|
row << registration.user.physical_tickets.by_conference(@conference).first&.token
@conference.questions.each do |question|
qa = registration.qanswers.find_by(question: question)
answer = ( qa ? qa.answer.title : '' )
answer = qa&.answer&.title || ''
row << answer
end