Commit 04561011177f5323f4fe0e18e7a0137d72b314ea
1 parent
a45f7262
Exists in
spb-stable
and in
2 other branches
Clean up conditional statement in `name` method.
Reverse the conditional order to avoid awkward `if !` construction.
Showing
1 changed file
with
3 additions
and
3 deletions
Show diff stats
lib/gitlab/oauth/user.rb
@@ -65,10 +65,10 @@ module Gitlab | @@ -65,10 +65,10 @@ module Gitlab | ||
65 | end | 65 | end |
66 | 66 | ||
67 | def name | 67 | def name |
68 | - if !auth.info.name.nil? | ||
69 | - auth.info.name.to_s.force_encoding('utf-8') | ||
70 | - else | 68 | + if auth.info.name.nil? |
71 | "#{auth.info.first_name} #{auth.info.last_name}".force_encoding('utf-8') | 69 | "#{auth.info.first_name} #{auth.info.last_name}".force_encoding('utf-8') |
70 | + else | ||
71 | + auth.info.name.to_s.force_encoding('utf-8') | ||
72 | end | 72 | end |
73 | end | 73 | end |
74 | 74 |