Skip to content

Instantly share code, notes, and snippets.

Created January 30, 2010 02:46
Show Gist options
  • Save anonymous/290369 to your computer and use it in GitHub Desktop.
Save anonymous/290369 to your computer and use it in GitHub Desktop.
module OnlineUsers
def count_online_users
User.count(:conditions => ["last_request_at > ?", 30.minutes.ago])
end
end
class User << ActiveRecord::Base
acts_as_authentic do |c|
c.logged_in_timeout 30.minutes
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment