diff --git a/app/controllers/contacts_controller.rb b/app/controllers/contacts_controller.rb index d42a8288d..403b5f2e5 100644 --- a/app/controllers/contacts_controller.rb +++ b/app/controllers/contacts_controller.rb @@ -19,7 +19,7 @@ class ContactsController < ApplicationController current_user.contacts.receiving end end - @contacts = @contacts.for_a_stream(params[:page]) + @contacts = @contacts.for_a_stream.paginate(:page => params[:page], :per_page => 25) respond_to do |format| format.json { diff --git a/app/models/contact.rb b/app/models/contact.rb index cd2f5f243..cf5e66be5 100644 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -37,10 +37,9 @@ class Contact < ActiveRecord::Base where(:receiving => true) } - scope :for_a_stream, lambda { |page| + scope :for_a_stream, lambda { includes(:aspects, :person => :profile). - order('profiles.last_name ASC'). - paginate(:page => page, :per_page => 25) + order('profiles.last_name ASC') } scope :only_sharing, lambda {