Include profile in contactsController index for the publisher

This commit is contained in:
Raphael Sofaer 2011-07-15 14:49:17 -07:00 committed by root
parent f60a748c21
commit 5d64611f2b

View file

@ -15,7 +15,7 @@ class ContactsController < ApplicationController
@people = Person.joins(:contacts => :aspect_memberships).
where(:contacts => {:user_id => current_user.id},
:aspect_memberships => {:aspect_id => params[:aspect_ids]})
render :json => @people.to_json
render :json => @people.includes(:profile).to_json
elsif params[:set] == "only_sharing"
@contacts = current_user.contacts.only_sharing.includes(:aspects, :person => :profile).order('profiles.last_name ASC').paginate(:page => params[:page], :per_page => 25)
elsif params[:set] != "all"