mirror of
https://github.com/ENSL/ensl.org.git
synced 2025-01-26 11:11:20 +00:00
show count for users signed in the last 30 days on users page
This commit is contained in:
parent
3edf8cc5e7
commit
f06dfc025a
3 changed files with 8 additions and 0 deletions
|
@ -99,6 +99,8 @@ class User < ActiveRecord::Base
|
|||
:conditions => "bans.id IS NOT NULL"
|
||||
scope :idle,
|
||||
:conditions => ["lastvisit < ?", 30.minutes.ago.utc]
|
||||
scope :lately,
|
||||
:conditions => ["lastvisit > ?", 30.days.ago.utc]
|
||||
|
||||
before_validation :update_password
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<h1 class="title">Listing Users</h1>
|
||||
<p><%= User.lately.count %> players have signed in within the past 30 days.</p>
|
||||
|
||||
<p>Search for users by name or Steam ID:</p>
|
||||
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
class AddLastvisitIndexToUsers < ActiveRecord::Migration
|
||||
def change
|
||||
add_index :users, :lastvisit
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue