Move contact pagination to controller - fixes #2760
This commit is contained in:
parent
b9ae426015
commit
7d4a81560d
2 changed files with 3 additions and 4 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue