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 33b35b8 commit a0c9f3dCopy full SHA for a0c9f3d
lib/api-pagination.rb
@@ -64,7 +64,12 @@ def paginate_with_pagy(collection, options)
64
end
65
66
def pagy_from(collection, options)
67
- count = collection.is_a?(Array) ? collection.count : collection.count(:all)
+ if options[:count]
68
+ count = options[:count]
69
+ else
70
+ count = collection.is_a?(Array) ? collection.count : collection.count(:all)
71
+ end
72
+
73
Pagy.new(count: count, items: options[:per_page], page: options[:page])
74
75
0 commit comments