修改判断整数的方法

This commit is contained in:
huang 2016-11-11 14:26:58 +08:00
parent 4d1d6506fe
commit 50a14ad5fe
1 changed files with 2 additions and 1 deletions

View File

@ -322,8 +322,9 @@ class User < Principal
end
# id 转换成 登录名
# 如果是整数就去ID否则就取login
def to_param
self.login.to_i > 0 ? id : login
self.login.to_i.to_s == self.login ? id : login
end