Please sign in to comment.
Only cache a single instance of uploaded attachments.
Prior to this fix, uploading an attachment (to a publication, for example) would result in the uploaded file being cached twice (in ./public/uploads/tmp/...). This is because the file is cached when the attachment model is instantiated and we were inadvertently instantiating it twice: once in DocumentsController#build_document and then again in DocumentsController::NationalApplicability#create. I added the failing test and then fixed the double instantiation by overriding the `#build_document` before filter so that it didn't fire for the `#create` action.
- Loading branch information...
Showing with 14 additions and 0 deletions.