Obfuscate documentable and imageable file names.

This commit is contained in:
Senén Rodero Rodríguez
2017-09-19 13:05:32 +02:00
parent f9b207c488
commit baf9ce90a9
6 changed files with 10 additions and 7 deletions

View File

@@ -1,7 +1,9 @@
class Document < ActiveRecord::Base
include DocumentsHelper
include DocumentablesHelper
has_attached_file :attachment, path: ":rails_root/public/system/:class/:prefix/:style/:filename"
has_attached_file :attachment, path: ":rails_root/public/system/:class/:prefix/:style/:hash.:extension",
url: "/system/:class/:prefix/:style/:hash.:extension",
hash_secret: Rails.application.secrets.secret_key_base
attr_accessor :cached_attachment
belongs_to :user