Skip to content

Commit

Permalink
Fix naming issue (mastodon#13551)
Browse files Browse the repository at this point in the history
  • Loading branch information
mayaeh authored Apr 27, 2020
1 parent c3ca380 commit acc367f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions config/initializers/paperclip.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
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
Expand All @@ -28,7 +28,7 @@

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
)

Expand Down Expand Up @@ -107,7 +107,7 @@
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

0 comments on commit acc367f

Please sign in to comment.