diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 16bd459..04cf7b3 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -50,7 +50,8 @@ class UsersController < ApplicationController # Recent user activity def activity - @user_logins = User.where(:last_sign_in_at => 1.month.ago..Time.now) + @zombie_members = User.where('sign_in_count = 0').where('member_level > 1') + @user_logins = User.where(:current_sign_in_at => 2.months.ago..Time.now).where('sign_in_count > 1') @new_users = User.where(:created_at => 3.months.ago..Date.today) @cardless_users = User.includes('cards').where(['users.member_level >= ?','50']).where('cards.id IS NULL') end diff --git a/app/views/users/activity.html.erb b/app/views/users/activity.html.erb index 49a5a4d..146a3f9 100644 --- a/app/views/users/activity.html.erb +++ b/app/views/users/activity.html.erb @@ -1,7 +1,8 @@
Name | +Member Level | +Account Created | ++ |
---|---|---|---|
<%= link_to user.name, user %> | +<%= user.member_level_string %> | +<%= distance_of_time_in_words DateTime.now, user.created_at %> ago | +