比如 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
http://api.rubyonrails.org/classes/ActiveRecord/Relation.html#method-i-update_all