Change direct uploads path

This commit is contained in:
Senén Rodero Rodríguez
2017-09-01 13:07:13 +02:00
parent 5581445fff
commit c3277d53c8

View File

@@ -1,7 +1,7 @@
class Document < ActiveRecord::Base
include DocumentsHelper
include DocumentablesHelper
has_attached_file :attachment, path: ":rails_root/public/system/:class/:attachment/:prefix/:style/:filename"
has_attached_file :attachment, path: ":rails_root/public/system/:class/:prefix/:style/:filename"
attr_accessor :cached_attachment
belongs_to :user
@@ -44,7 +44,7 @@ class Document < ActiveRecord::Base
if !attachment.instance.persisted?
"cached_attachments/user/#{attachment.instance.user_id}"
else
Paperclip::Interpolations.id_partition(attachment, style)
":attachment/:id_partition"
end
end