I am creating an application where I want to add online status for a given user.
Do I know that Devise has a user_signed_in method? to check if the user who uses the application is signed or not. But when I try to use it for another user, for example:
user_signed_in?(user)
user.user_signed_in?
I obviously get an undefined method error.
Does Devise have a method for this or should I write my own? One approach was to maintain the online status of a given user in a user model. What is the best solution for this?
source
share