From 0cfdd1a401f055c23e308a4b823bd250b1cbb3d3 Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Tue, 21 Feb 2023 19:54:36 -0500 Subject: Enable Rubocop Style/StringConcatenation defaults (#23792) --- lib/paperclip/gif_transcoder.rb | 2 +- lib/paperclip/type_corrector.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/paperclip') diff --git a/lib/paperclip/gif_transcoder.rb b/lib/paperclip/gif_transcoder.rb index f385b00a3..32bdb8a86 100644 --- a/lib/paperclip/gif_transcoder.rb +++ b/lib/paperclip/gif_transcoder.rb @@ -109,7 +109,7 @@ module Paperclip final_file = Paperclip::Transcoder.make(file, options, attachment) if options[:style] == :original - attachment.instance.file_file_name = File.basename(attachment.instance.file_file_name, '.*') + '.mp4' + attachment.instance.file_file_name = "#{File.basename(attachment.instance.file_file_name, '.*')}.mp4" attachment.instance.file_content_type = 'video/mp4' attachment.instance.type = MediaAttachment.types[:gifv] end diff --git a/lib/paperclip/type_corrector.rb b/lib/paperclip/type_corrector.rb index 17e2fc5da..030b98b12 100644 --- a/lib/paperclip/type_corrector.rb +++ b/lib/paperclip/type_corrector.rb @@ -7,7 +7,7 @@ module Paperclip def make return @file unless options[:format] - target_extension = '.' + options[:format] + target_extension = ".#{options[:format]}" extension = File.extname(attachment.instance_read(:file_name)) return @file unless options[:style] == :original && target_extension && extension != target_extension -- cgit