This was erroring when attachment was nil
(for example, if you just initialized a new Attachment without setting any value, and haven't saved it yet.)
I was getting the following error

TypeError:
       no implicit conversion of nil into String

This should fix the tests in this PR https://github.com/biola/academic-publisher/pull/17
Merge pull request #168 from biola/fixing_attachment_error

Fixing nil to string error in Attachment#to_s