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