Explorar el Código

Fixed trending

Andrew Kane hace 9 años
padre
commit
76dbf83255
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  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