summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2023-02-06 13:50:33 +0000
committerGo MAEDA <maeda@farend.jp>2023-02-06 13:50:33 +0000
commit57e702a69ba58d7076325ae8670508a2f225de89 (patch)
tree37ff53a5c4273cbc70f3acf9f1fb7eabe9f1c6ed
parent2496d4396b788995fe9f5f956be2a88d8198ca22 (diff)
downloadredmine-57e702a69ba58d7076325ae8670508a2f225de89.tar.gz
redmine-57e702a69ba58d7076325ae8670508a2f225de89.zip
Fix RuboCop offense Performance/StringInclude (#37247).
git-svn-id: https://svn.redmine.org/redmine/trunk@22097 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/models/principal.rb2
1 files changed, 1 insertions, 1 deletions
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|