diff --git a/app/components/avo/paginator_component.rb b/app/components/avo/paginator_component.rb index b80f5f4f11..a8f4dbfb68 100644 --- a/app/components/avo/paginator_component.rb +++ b/app/components/avo/paginator_component.rb @@ -28,7 +28,7 @@ def change_items_per_page_url(option) def render? return false if discreet_pagination && pagy.pages <= 1 - if defined?(@pagy.limit) + if ::Pagy::VERSION > ::Gem::Version.new("9.0") @pagy.limit > 0 else @pagy.items > 0 diff --git a/config/initializers/pagy.rb b/config/initializers/pagy.rb index d1b0357efd..9526f8c83d 100644 --- a/config/initializers/pagy.rb +++ b/config/initializers/pagy.rb @@ -1,6 +1,8 @@ require "pagy/extras/trim" require "pagy/extras/countless" -require "pagy/extras/size" +if ::Pagy::VERSION > ::Gem::Version.new("9.0") + require "pagy/extras/size" +end # For locales without native pagy i18n support def pagy_locale_path(file_name)