From 913629206e8d89dd641a6bfcfb143fc7da7c549c Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Sat, 31 Oct 2015 15:59:27 +0100 Subject: Don't include songs without any title in the PDF. --- lib/pdf_form.rb | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/pdf_form.rb b/lib/pdf_form.rb index 0695c47..9a831b3 100644 --- a/lib/pdf_form.rb +++ b/lib/pdf_form.rb @@ -32,13 +32,15 @@ class PDFForm subheading("Låter:") @band.songs.each do |song| - field("Tittel", song.to_s) - field("ISRC-kode:", song.isrc) - field("Utøvere:", song.performers) - field("Komponister:", song.composers) - field("Merknad:", song.notes) - next_line - @document.stroke { @document.horizontal_rule } + unless song.title.empty? + field("Tittel", song.to_s) + field("ISRC-kode:", song.isrc) + field("Utøvere:", song.performers) + field("Komponister:", song.composers) + field("Merknad:", song.notes) + next_line + @document.stroke { @document.horizontal_rule } + end end next_line -- cgit v1.2.3