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.17.0 app/controllers/concerns/shipit/pagination.rb
shipit-engine-0.16.0 app/controllers/concerns/shipit/pagination.rb
shipit-engine-0.15.0 app/controllers/concerns/shipit/pagination.rb
shipit-engine-0.14.0 app/controllers/concerns/shipit/pagination.rb
shipit-engine-0.13.0 app/controllers/concerns/shipit/pagination.rb
shipit-engine-0.12.1 app/controllers/concerns/shipit/pagination.rb
shipit-engine-0.12.0 app/controllers/concerns/shipit/pagination.rb
shipit-engine-0.11.0 app/controllers/concerns/shipit/pagination.rb
shipit-engine-0.10.0 app/controllers/concerns/shipit/pagination.rb
shipit-engine-0.9.0 app/controllers/concerns/shipit/pagination.rb
shipit-engine-0.8.9 app/controllers/concerns/shipit/pagination.rb
shipit-engine-0.8.8 app/controllers/concerns/shipit/pagination.rb
shipit-engine-0.8.7 app/controllers/concerns/shipit/pagination.rb
shipit-engine-0.8.6 app/controllers/concerns/shipit/pagination.rb
shipit-engine-0.8.5 app/controllers/concerns/shipit/pagination.rb
shipit-engine-0.8.4 app/controllers/concerns/shipit/pagination.rb
shipit-engine-0.8.3 app/controllers/concerns/shipit/pagination.rb
shipit-engine-0.8.2 app/controllers/concerns/shipit/pagination.rb
shipit-engine-0.8.1 app/controllers/concerns/shipit/pagination.rb
shipit-engine-0.8.0 app/controllers/concerns/shipit/pagination.rb