Sha256: 40618594bc2e10718de719db4e51c6013727010e19ab1e9a5ce2619ea1be8b1d

Contents?: true

Size: 562 Bytes

Versions: 46

Compression:

Stored size: 562 Bytes

Contents

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

46 entries across 46 versions & 1 rubygems

Version Path
shipit-engine-0.31.0 app/controllers/concerns/shipit/pagination.rb
shipit-engine-0.30.0 app/controllers/concerns/shipit/pagination.rb
shipit-engine-0.29.0 app/controllers/concerns/shipit/pagination.rb
shipit-engine-0.28.1 app/controllers/concerns/shipit/pagination.rb
shipit-engine-0.28.0 app/controllers/concerns/shipit/pagination.rb
shipit-engine-0.27.1 app/controllers/concerns/shipit/pagination.rb
shipit-engine-0.27.0 app/controllers/concerns/shipit/pagination.rb
shipit-engine-0.26.0 app/controllers/concerns/shipit/pagination.rb
shipit-engine-0.25.1 app/controllers/concerns/shipit/pagination.rb
shipit-engine-0.25.0 app/controllers/concerns/shipit/pagination.rb
shipit-engine-0.24.0 app/controllers/concerns/shipit/pagination.rb
shipit-engine-0.23.1 app/controllers/concerns/shipit/pagination.rb
shipit-engine-0.23.0 app/controllers/concerns/shipit/pagination.rb
shipit-engine-0.22.0 app/controllers/concerns/shipit/pagination.rb
shipit-engine-0.21.0 app/controllers/concerns/shipit/pagination.rb
shipit-engine-0.20.1 app/controllers/concerns/shipit/pagination.rb
shipit-engine-0.20.0 app/controllers/concerns/shipit/pagination.rb
shipit-engine-0.19.0 app/controllers/concerns/shipit/pagination.rb
shipit-engine-0.18.1 app/controllers/concerns/shipit/pagination.rb
shipit-engine-0.18.0 app/controllers/concerns/shipit/pagination.rb