Really? All this magic stuff needs to be documented. Otherwise, no one will find out about it unless they source dive or get nuggets like this from forums/irc/etc.
On Feb 4, 2:31 pm, Matt Jones <[email protected]> wrote: > On Feb 4, 2010, at 4:27 PM, Zooper wrote: > > > > > I need to track the most recent user login date. I have been using > > the following in the front controller's index action: > > > User.update(current_user.id, {:updated_at => Time.now}) > > > This, works, but on the rare occations that someone revisits the home > > screen during a session, the date gets set again. It also seems a > > little silly to set the update_at field, which gets set correctly > > automatically when the user record is updated. I chose this field, > > because there is no danger of changing real user data. > > > So, I have two questions. > > 1. Is there a place to force a user record update right after login so > > thst it can only happen once? > > 2. Is there a better way to force an update to the user record to set > > the update_at field? > > Try adding a :datetime field to your user model named last_login_at - > I'll think you'll be shocked what happens.... :) > > --Matt Jones -- You received this message because you are subscribed to the Google Groups "Hobo Users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/hobousers?hl=en.
