What is used for last_sign_in_at in devise?

The last_sign_in_at User column in Devise is last_sign_in_at , which contains the previous current_sign_in_at value when current_sign_in_at updated.

Does last_sign_in_at any utility for Devise kernel functionality or module functionality, or is it just as a general convenience?

+7
ruby ruby-on-rails devise warden
source share
2 answers

Looking through the source code, it seems to be just an attribute of Trackable - it is meant simply as a general convenience.

https://github.com/plataformatec/devise/search?utf8=%E2%9C%93&q=last_sign_in_at

Also, the gemfile for Devise does not show anything that (I guess) this field would use.

So, just a general convenience.

+3
source share

last_sign_in_at - date and time of user login before their current session (if any). It will be nil if this is their first session.

The best name may have been earlier_in_value, because this is not the time that they signed in the last (current), this is the time before that.

The best way to explain this is by illustrating its use: when users subscribe to the site, if their last_signed_in_at less than the last update of your Terms and Conditions, send them to the acceptance page.

Like most attributes in the Trackable module, it is not used internally for development, although it is supported by it.

+3
source share

All Articles