From 87156f57b5b7b71be8a40e9cc568a87583b55144 Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Mon, 27 May 2024 05:41:45 -0400 Subject: [PATCH] Enable Style/StringConcatenation (#30428) --- .rubocop_todo.yml | 6 ------ config/initializers/paperclip.rb | 4 ++-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 064f622085..a70caad8c5 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -176,12 +176,6 @@ Style/SafeNavigation: Exclude: - 'app/models/concerns/account/finder_concern.rb' -# This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: Mode. -Style/StringConcatenation: - Exclude: - - 'config/initializers/paperclip.rb' - # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: WordRegex. # SupportedStyles: percent, brackets diff --git a/config/initializers/paperclip.rb b/config/initializers/paperclip.rb index b54fc6cf0c..5b9365a530 100644 --- a/config/initializers/paperclip.rb +++ b/config/initializers/paperclip.rb @@ -13,7 +13,7 @@ end Paperclip.interpolates :prefix_path do |attachment, _style| if attachment.storage_schema_version >= 1 && attachment.instance.respond_to?(:local?) && !attachment.instance.local? - 'cache' + File::SEPARATOR + "cache#{File::SEPARATOR}" else '' end @@ -159,7 +159,7 @@ else Paperclip::Attachment.default_options.merge!( storage: :filesystem, 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' + url: "#{ENV.fetch('PAPERCLIP_ROOT_URL', '/system')}/:prefix_url:class/:attachment/:id_partition/:style/:filename" ) end