From 57e702a69ba58d7076325ae8670508a2f225de89 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Mon, 6 Feb 2023 13:50:33 +0000 Subject: [PATCH] Fix RuboCop offense Performance/StringInclude (#37247). git-svn-id: https://svn.redmine.org/redmine/trunk@22097 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/principal.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/principal.rb b/app/models/principal.rb index 3c350d6a8..e62b5f320 100644 --- a/app/models/principal.rb +++ b/app/models/principal.rb @@ -179,7 +179,7 @@ class Principal < ActiveRecord::Base principal ||= principals.detect {|a| keyword.casecmp(a.login.to_s) == 0} principal ||= principals.detect {|a| keyword.casecmp(a.mail.to_s) == 0} - if principal.nil? && / /.match?(keyword) + if principal.nil? && keyword.include?(' ') firstname, lastname = *(keyword.split) # "First Last Throwaway" principal ||= principals.detect do |a| -- 2.39.5