From 6d114aff04abc2267fe337284d440e501077158b Mon Sep 17 00:00:00 2001 From: starswan Date: Thu, 9 Jan 2025 14:27:32 +0000 Subject: [PATCH] render secondary qualifications with subjects and awarding body --- app/helpers/pdf_helper.rb | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/app/helpers/pdf_helper.rb b/app/helpers/pdf_helper.rb index 8999e6af01..a544b14777 100644 --- a/app/helpers/pdf_helper.rb +++ b/app/helpers/pdf_helper.rb @@ -103,13 +103,15 @@ def add_secondary_qualification_details(pdf, qualification) pdf.move_down 5 pdf.text "Secondary Qualification", size: 12, style: :italic - secondary_qualification_data = [ - ["Name:", qualification.name], - ["Grade:", qualification.grade], - ["Year Awarded:", qualification.year], - ].reject { |row| row[1].blank? } - - render_table(pdf, secondary_qualification_data) + qualification.qualification_results.each do |result| + secondary_qualification_data = [ + ["Subject:", result.subject], + ["Grade:", result.grade], + (["Awarding Body:", result.awarding_body] unless result.awarding_body.blank?), + ["Year Awarded:", qualification.year], + ].compact + render_table(pdf, secondary_qualification_data) + end end def add_general_qualification_details(pdf, qualification)