- end
-
- updates = {}
- [:first_name, :last_name, :email, :prefs].each do |attr|
- updates[attr] = remote_user[attr.to_s]
+ %w[first_name last_name email prefs].each do |attr|
+ user.send(attr+'=', remote_user[attr])
+ end
+ if remote_user['username'].andand.length.andand > 0
+ user.set_initial_username(requested: remote_user['username'])
+ end