better online user list
This commit is contained in:
@@ -39,8 +39,12 @@ class User < ActiveRecord::Base
|
||||
!!self.confirmed
|
||||
end
|
||||
|
||||
def self.seen(time)
|
||||
# when you change this, change footer.html.erb as well?
|
||||
User.where("last_seen >= ?", time.ago).order("last_seen, desc")
|
||||
end
|
||||
|
||||
def online?
|
||||
# when you change this, change footer.html.erb as well!
|
||||
last_seen && last_seen > 2.minutes.ago
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user