From 540a3e68a601af907083348613de9e392186ad0d Mon Sep 17 00:00:00 2001 From: Maxwell Salzberg Date: Fri, 29 Jul 2011 17:44:53 -0700 Subject: [PATCH] remove an unused query, randomize the contacts on your home page --- app/controllers/aspects_controller.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index c2051bef8..a13b47fcb 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -18,7 +18,6 @@ class AspectsController < ApplicationController @aspects = current_user.aspects.where(:id => params[:a_ids]) else @aspects = current_user.aspects - @contacts_sharing_with = current_user.contacts.sharing.includes(:person => :profile) end aspect_ids = @aspects.map{|a| a.id} @@ -39,7 +38,7 @@ class AspectsController < ApplicationController all_selected_people = Person.joins(:contacts => :aspect_memberships). where(:contacts => {:user_id => current_user.id}, :aspect_memberships => {:aspect_id => aspect_ids}) - @selected_people = all_selected_people.select("DISTINCT people.*").limit(20).includes(:profile) + @selected_people = all_selected_people.select("DISTINCT people.*").order('RAND()').limit(20).includes(:profile) end @aspect_ids = @aspects.map { |a| a.id }