mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-04-02 06:51:40 +00:00
fix products controller spec erros
This commit is contained in:
@@ -63,7 +63,7 @@ module Api
|
||||
@products = product_query.
|
||||
ransack(query_params_with_defaults).
|
||||
result.
|
||||
page(params[:page] || DEFAULT_PAGE).
|
||||
page(params[:page] || 1).
|
||||
per(params[:per_page] || DEFAULT_PER_PAGE)
|
||||
|
||||
render_paged_products @products
|
||||
|
||||
@@ -16,11 +16,9 @@ module PaginationData
|
||||
params[:page].present? || params[:per_page].present?
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def default_per_page
|
||||
return unless defined? DEFAULT_PER_PAGE
|
||||
return unless defined? self.class::DEFAULT_PER_PAGE
|
||||
|
||||
DEFAULT_PER_PAGE
|
||||
self.class::DEFAULT_PER_PAGE
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user