title: Updating `current_sign_in_at` and `last_sign_in_at` in rails application
body: <p>I am using my own custom sign in logic using bcrypt. However I like to update two attributes (<code>current_sign_in_at</code> and <code>last_sign_in_at</code>) in my database. So, I followed the logic defined in Devise Gem to factor my solution.</p>
  
  <p>The way Devise Gem implement this in <a href="https://github.com/plataformatec/devise/blob/master/lib/devise/models/trackable.rb" rel="nofollow noreferrer">Devise::Models::Trackable.update_tracked_fields!</a> and invoked as a Warden callback in <a href="https://github.com/plataformatec/devise/blob/master/lib/devise/hooks/trackable.rb" rel="nofollow noreferrer">devise/hooks/trackable.rb</a>. However, following those two implementations doesn't do anything to the database upon sign in.</p>
  
  <p>So do I need a callback or something inside the controller to call this? <strong>Or to better ask my question how do I update <code>current_sign_in_at</code> and <code>last_sign_in_at</code> in my database upon a user sign in?</strong> </p>
  
  <p><strong>Note</strong> am not using Devise Gem for user authentication, am only following their robust implementation.</p>