修改判断整数的方法
This commit is contained in:
parent
4d1d6506fe
commit
50a14ad5fe
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue