summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2015-10-31 15:59:27 +0100
committerHarald Eilertsen <haraldei@anduin.net>2015-10-31 16:51:01 +0100
commit913629206e8d89dd641a6bfcfb143fc7da7c549c (patch)
treeaf49f95f3cacca318e771cdcec4b4faaab983812
parentc1fa8c69f8c71e011ca339cd13ef64dcf6104540 (diff)
downloadnorsk-urskog-registrations-913629206e8d89dd641a6bfcfb143fc7da7c549c.tar.gz
norsk-urskog-registrations-913629206e8d89dd641a6bfcfb143fc7da7c549c.tar.bz2
norsk-urskog-registrations-913629206e8d89dd641a6bfcfb143fc7da7c549c.zip
Don't include songs without any title in the PDF.
-rw-r--r--lib/pdf_form.rb16
1 files 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