can_paginate.rb 382 B

12345678910111213141516
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. module CanPaginate
  3. extend ActiveSupport::Concern
  4. def paginate_with(max: nil, default: nil)
  5. @paginate_max = max
  6. @paginate_default = default
  7. end
  8. private
  9. def pagination
  10. @pagination ||= CanPaginate::Pagination.new(params, max: @paginate_max, default: @paginate_default)
  11. end
  12. end