Skip to content

Commit

Permalink
chore: change pagy default size to integer (#3121)
Browse files Browse the repository at this point in the history
* chore: change pagy default size to integer

* 9< support
  • Loading branch information
Paul-Bob authored Aug 12, 2024
1 parent e7dfb86 commit 23404ea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/avo/concerns/pagination.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module Pagination
unless defined? PAGINATION_DEFAULTS
PAGINATION_DEFAULTS = {
type: :default,
size: [1, 2, 2, 1],
size: ::Pagy::VERSION >= ::Gem::Version.new("9.0") ? 9 : [1, 2, 2, 1],
}
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/generators/avo/templates/initializer/avo.tt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Avo.configure do |config|
# config.pagination = -> do
# {
# type: :default,
# size: [1, 2, 2, 1],
# size: 9, # `[1, 2, 2, 1]` for pagy < 9.0
# }
# end

Expand Down

0 comments on commit 23404ea

Please sign in to comment.