Fix select in postscontroller

This commit is contained in:
Raphael Sofaer 2011-03-15 18:36:27 -07:00
parent 68479481cf
commit 7636fec270

View file

@ -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