lib/cheque/copy.rb in cheque-0.1.0 vs lib/cheque/copy.rb in cheque-0.1.1
- old
+ new
@@ -57,10 +57,18 @@
path
end.call
end
+ def filename
+ File.basename(path)
+ end
+
+ def mimetype
+ 'application/pdf'
+ end
+
private
def prepare
title_box
cheque_copy_box(20)
@@ -201,10 +209,10 @@
def tempfilepath
@tempfilepath ||= File.join(
Dir.tmpdir,
Dir::Tmpname.make_tmpname(
- t('cheque.copy.title').downcase.gsub(/\W/, '_'),
+ "#{t('cheque.copy.title').downcase.gsub(/\W/, '_')}_",
"#{id}.pdf"
)
)
end