From cec30f9a05e2b5def4db6660043e34641a77dff7 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Sun, 25 Dec 2022 07:55:14 +0000 Subject: [PATCH] Fix RuboCop offense Performance/StringInclude in app/controllers/imports_controller.rb (#37247). git-svn-id: https://svn.redmine.org/redmine/trunk@21999 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/imports_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/imports_controller.rb b/app/controllers/imports_controller.rb index acb41999f..eb4b330bb 100644 --- a/app/controllers/imports_controller.rb +++ b/app/controllers/imports_controller.rb @@ -58,7 +58,7 @@ class ImportsController < ApplicationController end rescue CSV::MalformedCSVError, EncodingError => e - if e.is_a?(CSV::MalformedCSVError) && e.message !~ /Invalid byte sequence/ + if e.is_a?(CSV::MalformedCSVError) && !e.message.include?('Invalid byte sequence') flash.now[:error] = l(:error_invalid_csv_file_or_settings, e.message) else flash.now[:error] = l(:error_invalid_file_encoding, :encoding => ERB::Util.h(@import.settings['encoding'])) -- 2.39.5