Rails MySQL 字段为 datatime,手动调用 authenticate,value 参数要怎么写?

lin_style · May 10, 2012 · Last by huacnlee replied at May 10, 2012 · 2084 hits

比如 mysql 语句这么写:

update users set lastlogin_time=now() where id=20

rails 中要怎么写呢

if !user.update_attribute("lastlogin_time", ????)
  logger.error("update lastlogin_time failed. userid:#{user.id}")
end
You need to Sign in before reply, if you don't have an account, please Sign up first.