Use absolute urls on document cached_attachment

This commit is contained in:
Senén Rodero Rodríguez
2017-08-30 15:50:32 +02:00
parent 57930df535
commit 5e6d1d799f
2 changed files with 5 additions and 5 deletions

View File

@@ -115,8 +115,8 @@ module CommentableActions
def recover_documents_from_cache(resource)
return false unless resource.try(:documents)
resource.documents = resource.documents.each do |document|
if document.cached_attachment.present? && File.exists?(document.cached_attachment)
document.attachment = File.open(document.cached_attachment)
if document.cached_attachment.present?
document.attachment = URI.parse(document.cached_attachment)
end
end
end