Reputation: 839
I'm a newcomer to Ruby, and I'm trying to make a Rails app for class. Trouble is, being new to this all, I've hit an impasse and I don't know the best way to achieve my goals.
My app is this:
Thus far I've set up my models and have authentication with Devise.
How best would you recommend I go about setting up the 'check-in'?
Any and all suggestions and help much appreciated, thanks!
Upvotes: 1
Views: 270
Reputation: 2659
You can use devise Trackable
module for satisfied your needs.
It will track with below column
sign_in_count - Increased every time a sign in is made (by form, openid, oauth)
current_sign_in_at - A timestamp updated when the user signs in
last_sign_in_at - Holds the timestamp of the previous sign in
current_sign_in_ip - The remote ip updated when the user sign in
last_sign_in_ip - Holds the remote ip of the previous sign in
You can make your logic depends on this fields.
Fore more information visit : http://www.rubydoc.info/github/plataformatec/devise/master/Devise/Models/Trackable
Upvotes: 3