aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/CHANGELOG2
-rw-r--r--actionpack/lib/action_controller/pagination.rb6
2 files changed, 5 insertions, 3 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG
index 4ec1701839..19e037e909 100644
--- a/actionpack/CHANGELOG
+++ b/actionpack/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Fixed pagination to work with joins #1034 [scott@sigkill.org]
+
* Fixed that *rest parameter in map.connect couldn't accept an empty list #1037 [Dee.Zsombor@gmail.com]
* Added :confirm option to link_to_remote just like link_to has #1082 [yrashk@fp.org.ua]
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)