0.0
No commit activity in last 3 years
No release in over 3 years
Track the last request and logout. Provides user.active? and User.actives methods
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

~> 2.2.2
~> 3.2.8
~> 1.2.1
 Project Readme

devise_sociable¶ ↑

This gem adds the ability to see who’s currently online to devise. You can use it with server side or cookie based sessions.

Usage¶ ↑

If you use server side sessions and have that setup, there is no migration needed.

If you use cookie sessions (this is the Rails default):

rails g devise_sociable
rake db:migrate

In your model, add :sociable:

class User < ActiveRecord::Base
  devise ..., :sociable
end

Then you have access to

User.actives(10.minutes)    #everybody who has been active and not logged off in the last 10 minutes
User.actives(10.minutes.ago)

user.active?(1.hour)       #has this user been active and not logged off in the last hour
user.active?(1.hour.ago)

User.cache_actives(30.minutes)  #fill a cache with all active users. use an outside scheduler like ::whenever:: to refresh.

This is pretty experimental, but I think it ought to work.

Thanks to¶ ↑

Thanks to devise_lastseenable which led me down the path of creating this gem.

Copyright © 2013 beno. See LICENSE.txt for further details.