diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pdf_form.rb | 4 | ||||
-rw-r--r-- | lib/registration.rb | 8 |
2 files changed, 8 insertions, 4 deletions
diff --git a/lib/pdf_form.rb b/lib/pdf_form.rb index 19756a7..0695c47 100644 --- a/lib/pdf_form.rb +++ b/lib/pdf_form.rb @@ -7,7 +7,7 @@ class PDFForm @document = Prawn::Document.new(:page_size => "A4") end - def render + def render(filename) heading next_line @@ -45,7 +45,7 @@ class PDFForm end_text @document.number_pages "Side <page>", :align => :center, :at => [0, 0] - @document.render_file "#{@band.name}.pdf" + @document.render_file filename end private diff --git a/lib/registration.rb b/lib/registration.rb index 9826f91..5ace438 100644 --- a/lib/registration.rb +++ b/lib/registration.rb @@ -13,7 +13,11 @@ def send_registration_emails_for(band) mail.deliver! end -def generate_pdf_for(band) +def generate_pdf_for(band, filename) pdf = PDFForm.new(band) - pdf.render + pdf.render(filename) +end + +def create_pdf_file_name(band) + filename = "#{Date.today.iso8601}-#{band.name}-#{band.city}.pdf" end |