end
end
-Paperclip.interpolates :path_prefix do |attachment, style|
+Paperclip.interpolates :prefix_path do |attachment, style|
if attachment.storage_schema_version >= 1 && attachment.instance.respond_to?(:local?) && !attachment.instance.local?
'cache' + File::SEPARATOR
else
end
end
-Paperclip.interpolates :url_prefix do |attachment, style|
+Paperclip.interpolates :prefix_url do |attachment, style|
if attachment.storage_schema_version >= 1 && attachment.instance.respond_to?(:local?) && !attachment.instance.local?
'cache/'
else
Paperclip::Attachment.default_options.merge!(
use_timestamp: false,
- path: ':url_prefix:class/:attachment/:id_partition/:style/:filename',
+ path: ':prefix_url:class/:attachment/:id_partition/:style/:filename',
storage: :fog
)
Paperclip::Attachment.default_options.merge!(
storage: :filesystem,
use_timestamp: true,
- path: File.join(ENV.fetch('PAPERCLIP_ROOT_PATH', File.join(':rails_root', 'public', 'system')), ':path_prefix:class', ':attachment', ':id_partition', ':style', ':filename'),
- url: ENV.fetch('PAPERCLIP_ROOT_URL', '/system') + '/:url_prefix:class/:attachment/:id_partition/:style/:filename',
+ path: File.join(ENV.fetch('PAPERCLIP_ROOT_PATH', File.join(':rails_root', 'public', 'system')), ':prefix_path:class', ':attachment', ':id_partition', ':style', ':filename'),
+ url: ENV.fetch('PAPERCLIP_ROOT_URL', '/system') + '/:prefix_url:class/:attachment/:id_partition/:style/:filename',
)
end