Make documentable capable to work with local or remote storage system.

This commit is contained in:
Senén Rodero Rodríguez
2017-08-30 17:07:52 +02:00
parent 5e6d1d799f
commit 6d66077a94
3 changed files with 21 additions and 6 deletions

View File

@@ -115,9 +115,7 @@ 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?
document.attachment = URI.parse(document.cached_attachment)
end
document.set_attachment_from_cache if document.cached_attachment.present?
end
end