Move contact pagination to controller - fixes #2760

This commit is contained in:
Sarah Mei
2012-01-27 21:56:27 -08:00
parent b9ae426015
commit 7d4a81560d
2 changed files with 3 additions and 4 deletions

View File

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

View File

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