Add and apply Style/StringChars rubocop rule

This rule was added in Rubocop 1.12.0.
This commit is contained in:
Javi Martín
2021-08-11 18:16:20 +02:00
parent 2bc6018465
commit ac5c9459c7
2 changed files with 4 additions and 1 deletions

View File

@@ -538,6 +538,9 @@ Style/SingleLineMethods:
Style/SoleNestedConditional: Style/SoleNestedConditional:
Enabled: true Enabled: true
Style/StringChars:
Enabled: true
Style/StringLiterals: Style/StringLiterals:
EnforcedStyle: double_quotes EnforcedStyle: double_quotes

View File

@@ -47,7 +47,7 @@ class Management::UsersController < Management::BaseController
end end
def user_without_email def user_without_email
new_password = "aAbcdeEfghiJkmnpqrstuUvwxyz23456789$!".split("").sample(10).join new_password = "aAbcdeEfghiJkmnpqrstuUvwxyz23456789$!".chars.sample(10).join
@user.password = new_password @user.password = new_password
@user.password_confirmation = new_password @user.password_confirmation = new_password