mirror of
https://github.com/openSUSE/osem.git
synced 2026-09-08 11:49:25 -04:00
Add Style/SelfAssignment Rubocop cop
The cop enforces use of self assignment operator E.g. a=a+2 gets written as a+=2. Also the offenses listed in rubocop.todo.yml have been corrected automatically with the --auto-correct option. Fixes issue #1531
This commit is contained in:
1 parent
be72b9d02e
commit
cdf794ecbf
5 files changed
+7
-13
No files matched your search
@@ -7,9 +7,7 @@ class GenerateUsername < ActiveRecord::Migration
|
||||
TempUser.all.each do |user|
|
||||
if user.username.blank?
|
||||
username = user.email.split('@')[0]
|
||||
if TempUser.find_by(username: username)
|
||||
username = username + user.id.to_s
|
||||
end
|
||||
username += user.id.to_s if TempUser.find_by(username: username)
|
||||
user.update_attributes(username: username)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user