Sha256: a6f201caf7afb2c684f4588dfb29c0ef3ce76c10ffa8a63e9c4a68febba6c3ce

Contents?: true

Size: 594 Bytes

Versions: 10

Compression:

Stored size: 594 Bytes

Contents

# frozen_string_literal: true
module Shipit
  module Pagination
    extend ActiveSupport::Concern

    included do
      class_attribute :max_page_size
      class_attribute :default_page_size
      class_attribute :default_order

      self.max_page_size = 100
      self.default_page_size = 30
      self.default_order = { id: :desc }.freeze
    end

    private

    def paginate(relation)
      Shipit::Paginator.new(
        relation,
        self,
        order: default_order,
        max_page_size: max_page_size,
        default_page_size: default_page_size,
      )
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
shipit-engine-0.39.0 app/controllers/concerns/shipit/pagination.rb
shipit-engine-0.38.0 app/controllers/concerns/shipit/pagination.rb
shipit-engine-0.37.0 app/controllers/concerns/shipit/pagination.rb
shipit-engine-0.36.1 app/controllers/concerns/shipit/pagination.rb
shipit-engine-0.36.0 app/controllers/concerns/shipit/pagination.rb
shipit-engine-0.35.1 app/controllers/concerns/shipit/pagination.rb
shipit-engine-0.35.0 app/controllers/concerns/shipit/pagination.rb
shipit-engine-0.34.0 app/controllers/concerns/shipit/pagination.rb
shipit-engine-0.33.0 app/controllers/concerns/shipit/pagination.rb
shipit-engine-0.32.0 app/controllers/concerns/shipit/pagination.rb