summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2024-09-01 06:05:39 +0000
committerGo MAEDA <maeda@farend.jp>2024-09-01 06:05:39 +0000
commitd24d11a6825eda4e4efee455e2aafff01a16616a (patch)
treedf82edd26447097f5f8005461316b74e4b919d3d
parentab4eac416ae60fa0fa75dba914eb642d3622faa7 (diff)
downloadredmine-d24d11a6825eda4e4efee455e2aafff01a16616a.tar.gz
redmine-d24d11a6825eda4e4efee455e2aafff01a16616a.zip
Fix RuboCop offense Style/StringChars (#39887).
git-svn-id: https://svn.redmine.org/redmine/trunk@23009 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--.rubocop_todo.yml5
-rw-r--r--app/models/user.rb2
2 files changed, 1 insertions, 6 deletions
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index 729c60209..fd17051b9 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -1272,11 +1272,6 @@ Style/StderrPuts:
- 'config/initializers/10-patches.rb'
# This cop supports unsafe autocorrection (--autocorrect-all).
-Style/StringChars:
- Exclude:
- - 'app/models/user.rb'
-
-# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: Mode.
Style/StringConcatenation:
Enabled: false
diff --git a/app/models/user.rb b/app/models/user.rb
index 2d012fa41..2f4baba58 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -371,7 +371,7 @@ class User < Principal
end
chars = chars_list.flatten
length.times {password << chars[SecureRandom.random_number(chars.size)]}
- password = password.split('').shuffle(random: SecureRandom).join
+ password = password.chars.shuffle(random: SecureRandom).join
self.password = password
self.password_confirmation = password
self