From d24d11a6825eda4e4efee455e2aafff01a16616a Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Sun, 1 Sep 2024 06:05:39 +0000 Subject: Fix RuboCop offense Style/StringChars (#39887). git-svn-id: https://svn.redmine.org/redmine/trunk@23009 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- .rubocop_todo.yml | 5 ----- app/models/user.rb | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 729c60209..fd17051b9 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1271,11 +1271,6 @@ Style/StderrPuts: - 'config/environment.rb' - '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: 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 -- cgit v1.2.3