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

@@ -8,8 +8,9 @@ class Image < ActiveRecord::Base
ACCEPTED_CONTENT_TYPE = %w(image/jpeg image/jpg)
has_attached_file :attachment, styles: { large: "x#{MIN_SIZE}", medium: "300x300#", thumb: "140x245#" },
path: ":rails_root/public/system/:class/:prefix/:style/:filename",
url: "/system/:class/:prefix/:style/:filename"
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