From 7636fec270b50be3a2304118202bfb8efb7e4343 Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Tue, 15 Mar 2011 18:36:27 -0700 Subject: [PATCH] Fix select in postscontroller --- app/controllers/posts_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb index 9446e8252..5157b92c8 100644 --- a/app/controllers/posts_controller.rb +++ b/app/controllers/posts_controller.rb @@ -22,8 +22,8 @@ class PostsController < ApplicationController @posts = @posts.tagged_with(params[:tag]) @posts = @posts.includes(:comments, :photos).paginate(:page => params[:page], :per_page => 15, :order => 'created_at DESC') - profiles = Profile.tagged_with(params[:tag]).where(:searchable => true).select('profiles.id') - @people = Person.where(:id => profiles.map{|p| p.id}).limit(15) + profiles = Profile.tagged_with(params[:tag]).where(:searchable => true).select('profiles.id, profiles.person_id') + @people = Person.where(:id => profiles.map{|p| p.person_id}).limit(15) @fakes = PostsFake.new(@posts) @commenting_disabled = true