lib/active_admin/views/components/paginated_collection.rb in activeadmin-1.4.3 vs lib/active_admin/views/components/paginated_collection.rb in activeadmin-2.0.0.rc1
- old
+ new
@@ -100,10 +100,10 @@
# The #paginate method in kaminari will query the resource with a
# count(*) to determine how many pages there should be unless
# you pass in the :total_pages option. We issue a query to determine
# if there is another page or not, but the limit/offset make this
# query fast.
- offset = collection.offset(collection.current_page * @per_page.to_i).limit(1).count
+ offset = collection.offset(collection.current_page * collection.limit_value).limit(1).count
options[:total_pages] = collection.current_page + offset
options[:right] = 0
end
text_node paginate collection, options