From 75199abb7e8189b65e97df905b59b1e2161d0039 Mon Sep 17 00:00:00 2001
From: Marcela Ribeiro de Oliveira <mro15@inf.ufpr.br>
Date: Wed, 11 Jan 2017 12:58:45 -0200
Subject: [PATCH] change owner of attachment to be portalmec

---
 app/workers/attachment_cache_worker.rb | 1 +
 1 file changed, 1 insertion(+)

diff --git a/app/workers/attachment_cache_worker.rb b/app/workers/attachment_cache_worker.rb
index 248337bd..5e8bb82d 100644
--- a/app/workers/attachment_cache_worker.rb
+++ b/app/workers/attachment_cache_worker.rb
@@ -18,6 +18,7 @@ class AttachmentCacheWorker
       FileUtils.mkdir_p(directory_root)
       FileUtils.mv(file.path, file_root)
       FileUtils.chmod 0644, file_root.to_s, verbose: true
+      FileUtils.chown_R 'portalmec', 'www-data', directory_root.to_s, verbose: true
       @attachment.update(cache_link: cache_link)
     ensure
       file.close if !file.nil? && File.exist?(file.path)
-- 
GitLab