Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixing top searches

  • Loading branch information...
commit 7efd56f2600b5eeaa39d9e88a2118162d38ad834 1 parent d2422d5
@cjstewart88 authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 app/controllers/stats_controller.rb
View
4 app/controllers/stats_controller.rb
@@ -24,7 +24,7 @@ def past_7_days_stats
@past_7_days_stats << ["Favorites" , Favorites.where("created_at >= ?", Date.today-7).count]
@past_7_days_stats << ["Users" , User.where("created_at >= ?", Date.today-7).count]
- top_past_7_days_searches = Searches.where("created_at >= ?", Date.today-7).group("what").count
+ top_past_7_days_searches = Searches.where("created_at >= ? AND search_type != ?", Date.today-7, 'favorites').group("what").count
top_past_7_days_searches.delete("Enter Artist or Band Here")
@top_past_7_days_searches = top_past_7_days_searches.sort_by{ |k, v| -v }[0...5]
end
@@ -36,7 +36,7 @@ def today_stats
@today_stats << ["Favorites" , Favorites.where("created_at >= ?", Date.today).count]
@today_stats << ["Users" , User.where("created_at >= ?", Date.today).count]
- top_searches_today = Searches.where("created_at >= ?", Date.today).group("what").count
+ top_searches_today = Searches.where("created_at >= ? AND search_type != ?", Date.today, 'favorites').group("what").count
top_searches_today.delete("Enter Artist or Band Here")
@top_searches_today = top_searches_today.sort_by{ |k, v| -v }[0...5]
end
Please sign in to comment.
Something went wrong with that request. Please try again.