diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-04-13 05:40:22 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-04-13 05:40:22 +0000 |
commit | ad24c6d756f1fb0f78028f19b7922cc5490d5d74 (patch) | |
tree | e81dbd467fbec09ee66a97b5b852bbd5b7edc36d /actionpack/lib/action_controller/pagination.rb | |
parent | 7f558cbd05535f80dfb56198c803df09896c202b (diff) | |
download | rails-ad24c6d756f1fb0f78028f19b7922cc5490d5d74.tar.gz rails-ad24c6d756f1fb0f78028f19b7922cc5490d5d74.tar.bz2 rails-ad24c6d756f1fb0f78028f19b7922cc5490d5d74.zip |
Fixed pagination to work with joins #1034 [scott@sigkill.org]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1159 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller/pagination.rb')
-rw-r--r-- | actionpack/lib/action_controller/pagination.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_controller/pagination.rb b/actionpack/lib/action_controller/pagination.rb index fd890c53e0..e0fccc0ce0 100644 --- a/actionpack/lib/action_controller/pagination.rb +++ b/actionpack/lib/action_controller/pagination.rb @@ -150,8 +150,8 @@ module ActionController # Returns the total number of items in the collection to be paginated for # the +model+ and given +conditions+. Override this method to implement a # custom counter. - def count_collection_for_pagination(model, conditions) - model.count(conditions) + def count_collection_for_pagination(model, conditions, joins) + model.count(conditions,joins) end # Returns a collection of items for the given +model+ and +conditions+, @@ -168,7 +168,7 @@ module ActionController def paginator_and_collection_for(collection_id, options) #:nodoc: klass = options[:class_name].constantize page = @params[options[:parameter]] - count = count_collection_for_pagination(klass, options[:conditions]) + count = count_collection_for_pagination(klass, options[:conditions], options[:join]) paginator = Paginator.new(self, count, options[:per_page], page) |