views:

83

answers:

1

I am using the Authlogicgem for authentication and most of it seems to be working great. Authlogic provides several columns that you can add to your Users table (for example) that it knows to fill in if they are present. i.e. login_count, current_login_ip, last_request_at and last_login_at.

All seem to be working fine with the exception of the last_login_at field which is null for each user.

Is there anything specific that could be causing this perhaps having to do with the user sessions, etc? I can post code if needed but wasn't sure what would relate to this.

A: 

My guess is that you are missing the current_login_at column, without it last_login_at will not work.

see: here

if record.respond_to?(:current_login_at)
   record.last_login_at = record.current_login_at if record.respond_to?(:last_login_at)
   record.current_login_at = klass.default_timezone == :utc ? Time.now.utc : Time.now
end
Sam Saffron
that did it. Thanks.
bgadoci