From 15836b4f4e21ae353f9fa07a8301da15dde35598 Mon Sep 17 00:00:00 2001 From: Will Bradley Date: Sun, 6 Oct 2013 05:17:24 -0700 Subject: [PATCH] Adding zombie report --- app/controllers/users_controller.rb | 3 ++- app/views/users/activity.html.erb | 25 ++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) 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 @@

Member Onboarding/Activity

New Users | Members Without Cards | -Logins +Logins | +Never-Logged-In Members

New Users

@@ -114,3 +115,25 @@ <% end %> + +

Never-Logged-In Members

+Excluding non-members + + + + + + + + +<% if !@zombie_members.blank? %> + <% @zombie_members.sort_by(&:created_at).reverse!.each do |user| %> + + + + + <% end %> +<% end %> +
NameMember LevelAccount Created
<%= link_to user.name, user %><%= user.member_level_string %><%= distance_of_time_in_words DateTime.now, user.created_at %> ago
+