Browse Source

Fixed trending

Andrew Kane 9 years ago
parent
commit
76dbf83255
1 changed files with 1 additions and 1 deletions
  1. 1 1
      app/controllers/blazer/queries_controller.rb

+ 1 - 1
app/controllers/blazer/queries_controller.rb

@@ -16,7 +16,7 @@ module Blazer
 
     def index
       @queries = Blazer::Query.order(:name).includes(:creator)
-      @trending_queries = Blazer::Audit.group(:query_id).where("created_at > ?", 2.days.ago).having("COUNT(*) >= 3").uniq.count(:user_id)
+      @trending_queries = Blazer::Audit.group(:query_id).where("created_at > ?", 2.days.ago).having("COUNT(DISTINCT user_id) >= 3").uniq.count(:user_id)
     end
 
     def new