X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/ef7f3d800cbdd49b692df10d312e5fd880e2e938..8a39c6b4a223160d47b293bc07d57d4e77685746:/config/initializers/paperclip.rb diff --git a/config/initializers/paperclip.rb b/config/initializers/paperclip.rb index 75f6d2371..3aa1d003e 100644 --- a/config/initializers/paperclip.rb +++ b/config/initializers/paperclip.rb @@ -5,8 +5,8 @@ module Paperclip def for(style_name, options) url = super(style_name, options) - if url =~ /^\/assets\/(.*)$/ - asset_path($1) + if url =~ %r{^/assets/(.*)$} + asset_path(Regexp.last_match(1)) else url end @@ -21,5 +21,5 @@ Rails.application.config.after_initialize do |_app| end Paperclip::Attachment.default_options[:url] = "/attachments/:class/:attachment/:id_partition/:style/:fingerprint.:extension" -Paperclip::Attachment.default_options[:path] = "#{ATTACHMENTS_DIR}/:class/:attachment/:id_partition/:style/:fingerprint.:extension" +Paperclip::Attachment.default_options[:path] = "#{Settings.attachments_dir}/:class/:attachment/:id_partition/:style/:fingerprint.:extension" Paperclip::Attachment.default_options[:url_generator] = Paperclip::AssetUrlGenerator