mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-25 20:46:48 +00:00
- Apply OR when filtering by both product properties and supplier properties - Apply AND when filtering by supplier properties and taxon Filtering by product properties and taxon is handled by ransack, so no change there
20 lines
618 B
Ruby
20 lines
618 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'pagy/extras/arel'
|
|
require 'pagy/extras/array'
|
|
require 'pagy/extras/items'
|
|
require 'pagy/extras/overflow'
|
|
|
|
# Pagy Variables
|
|
# See https://ddnexus.github.io/pagy/api/pagy#variables
|
|
Pagy::DEFAULT[:items] = 100
|
|
|
|
# Items extra: Allow the client to request a custom number of items per page with an optional
|
|
# selector UI
|
|
# See https://ddnexus.github.io/pagy/extras/items
|
|
Pagy::DEFAULT[:items_param] = :per_page
|
|
Pagy::DEFAULT[:max_items] = 100
|
|
|
|
# For handling requests for non-existant pages eg: page 35 when there are only 4 pages of results
|
|
Pagy::DEFAULT[:overflow] = :empty_page
|