More nil answers
This commit is contained in:
parent
f7768bd1f8
commit
8ae9bf2e54
3 changed files with 3 additions and 3 deletions
|
|
@ -5,7 +5,7 @@
|
|||
%h1= @question.title
|
||||
- @question.answers.each do |answer|
|
||||
= answer.title
|
||||
(#{answer.qanswers.find_by(question: @question).registrations.where(conference: @conference).count})
|
||||
(#{answer.qanswers.find_by(question: @question)&.registrations&.where(conference: @conference)&.count || 0})
|
||||
|
||||
|
||||
.row
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue