在我的应用中,用户可以以其他用户身份登录...
有点像这样:
desired_user.remember_me = true
sign_in(:user, desired_user.user)
问题在于它是用两次昂贵的更新来击中数据库两次......
AREL (0.6ms) UPDATE "users" SET "remember_created_at" = '2011-08-23 00:53:28.354913', "updated_at" = '2011-08-23 00:53:28.355860' WHERE "users"."id" = 3
AREL (0.8ms) UPDATE "users" SET "last_sign_in_at" = '2011-08-23 00:52:16.255813', "current_sign_in_at" = '2011-08-23 00:53:28.391764', "sign_in_count" = 152, "updated_at" = '2011-08-23 00:53:28.393429' WHERE "users"."id" = 3
[paperclip] Saving attachments.
有没有办法在一个电话中执行此操作。一种同时签名并记住的方法?我无法在文档中找到这个。感谢