Adjust filename obfuscation to be able to remove cached uploads
This commit is contained in:
@@ -1,8 +1,9 @@
|
|||||||
class Document < ActiveRecord::Base
|
class Document < ActiveRecord::Base
|
||||||
include DocumentsHelper
|
include DocumentsHelper
|
||||||
include DocumentablesHelper
|
include DocumentablesHelper
|
||||||
has_attached_file :attachment, path: ":rails_root/public/system/:class/:prefix/:style/:hash.:extension",
|
has_attached_file :attachment, url: "/system/:class/:prefix/:style/:hash.:extension",
|
||||||
url: "/system/:class/:prefix/:style/:hash.:extension",
|
hash_data: ":class/:style",
|
||||||
|
use_timestamp: false,
|
||||||
hash_secret: Rails.application.secrets.secret_key_base
|
hash_secret: Rails.application.secrets.secret_key_base
|
||||||
attr_accessor :cached_attachment
|
attr_accessor :cached_attachment
|
||||||
|
|
||||||
|
|||||||
@@ -8,8 +8,9 @@ class Image < ActiveRecord::Base
|
|||||||
ACCEPTED_CONTENT_TYPE = %w(image/jpeg image/jpg)
|
ACCEPTED_CONTENT_TYPE = %w(image/jpeg image/jpg)
|
||||||
|
|
||||||
has_attached_file :attachment, styles: { large: "x#{MIN_SIZE}", medium: "300x300#", thumb: "140x245#" },
|
has_attached_file :attachment, styles: { large: "x#{MIN_SIZE}", medium: "300x300#", thumb: "140x245#" },
|
||||||
path: ":rails_root/public/system/:class/:prefix/:style/:hash.:extension",
|
|
||||||
url: "/system/:class/:prefix/:style/:hash.:extension",
|
url: "/system/:class/:prefix/:style/:hash.:extension",
|
||||||
|
hash_data: ":class/:style",
|
||||||
|
use_timestamp: false,
|
||||||
hash_secret: Rails.application.secrets.secret_key_base
|
hash_secret: Rails.application.secrets.secret_key_base
|
||||||
attr_accessor :cached_attachment
|
attr_accessor :cached_attachment
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user