lastname为空时也可以加,可以省掉查询extensions的语句

This commit is contained in:
guange 2015-12-12 18:06:59 +08:00
parent 3476731b83
commit 91b245ad2c
1 changed files with 1 additions and 10 deletions

View File

@ -399,16 +399,7 @@ class User < Principal
end
def show_name
name = ""
unless self.user_extensions.nil?
if self.user_extensions.identity == 2
name = firstname
else
name = lastname+firstname
end
else
name = lastname+firstname
end
name = lastname + firstname
name.empty? || name.nil? ? login : name
end
## end