Improve performance of admin/conference/*/registrations
* Add some caching * Reduce query count, including N+1s on questions & roles
This commit is contained in:
parent
6987c34e12
commit
66ea7c077d
5 changed files with 66 additions and 65 deletions
|
|
@ -23,10 +23,8 @@ prawn_document(force_download: true, filename: @pdf_filename, page_layout: :land
|
|||
row << registration.departure.to_s || ''
|
||||
|
||||
@conference.questions.each do |question|
|
||||
qa = registration.qanswers.find_by(question: question)
|
||||
answer = ( qa ? qa.answer.title : '' )
|
||||
|
||||
row << answer
|
||||
qa = registration.qanswers.find{|qa| qa.question_id == question.id }
|
||||
row << ( qa ? qa.answer.title : '' )
|
||||
end
|
||||
|
||||
table_array << row
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue