# Last\_login type field

**URL:** <https://www.ruby-forum.com/t/last-login-type-field/111350>\
**Category:** Rails\
**Created:** [August 6, 2007, 12:46pm UTC](https://www.ruby-forum.com/t/last-login-type-field/111350 "2007-08-06T12:46:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tobycatlin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/5e9695/32.png) [@tobycatlin](https://www.ruby-forum.com/u/tobycatlin)\
**Post date:** [August 6, 2007, 12:46pm UTC](https://www.ruby-forum.com/t/last-login-type-field/111350/1 "2007-08-06T12:46:53Z")

</div>

Hi,

In my user authentication I’d like to be able to register when a user  
last logged on to the system. I currently have an update\_usage method  
in my model that sets a last\_login field to Time.now() on successful  
login. The table also includes the updated\_on field.

Is there a way of ‘touching’ a record so that the updated\_on field is  
set even though no other record fields are updated? At the moment  
there is some unnecessary duplication.

Thanks,  
Tobe
