Created
January 30, 2010 02:46
-
-
Save anonymous/290369 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module OnlineUsers | |
def count_online_users | |
User.count(:conditions => ["last_request_at > ?", 30.minutes.ago]) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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