8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6c7ff56 commit 08d764cCopy full SHA for 08d764c
lib/api-pagination.rb
@@ -64,7 +64,8 @@ def paginate_with_pagy(collection, options)
64
end
65
66
def pagy_from(collection, options)
67
- Pagy.new(count: collection.count, items: options[:per_page], page: options[:page])
+ count = collection.is_a?(Array) ? collection.count : collection.count(:all)
68
+ Pagy.new(count: count, items: options[:per_page], page: options[:page])
69
70
71
def pagy_pages_from(pagy)
0 commit comments