Sha256: 4264cc581f18343f8f283e22e3eb23229c2dfe1e08ec4f2ac3d04d2987eada1f

Contents?: true

Size: 502 Bytes

Versions: 21

Compression:

Stored size: 502 Bytes

Contents

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

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
shipit-engine-0.5.2 app/controllers/concerns/pagination.rb
shipit-engine-0.5.1 app/controllers/concerns/pagination.rb
shipit-engine-0.5.0 app/controllers/concerns/pagination.rb
shipit-engine-0.4.10 app/controllers/concerns/pagination.rb
shipit-engine-0.4.9 app/controllers/concerns/pagination.rb
shipit-engine-0.4.8 app/controllers/concerns/pagination.rb
shipit-engine-0.4.7 app/controllers/concerns/pagination.rb
shipit-engine-0.4.6 app/controllers/concerns/pagination.rb
shipit-engine-0.4.5 app/controllers/concerns/pagination.rb
shipit-engine-0.4.4 app/controllers/concerns/pagination.rb
shipit-engine-0.4.3 app/controllers/concerns/pagination.rb
shipit-engine-0.4.2 app/controllers/concerns/pagination.rb
shipit-engine-0.4.1 app/controllers/concerns/pagination.rb
shipit-engine-0.4.0 app/controllers/concerns/pagination.rb
shipit-engine-0.3.1 app/controllers/concerns/pagination.rb
shipit-engine-0.3.0 app/controllers/concerns/pagination.rb
shipit-engine-0.2.3 app/controllers/concerns/pagination.rb
shipit-engine-0.2.2 app/controllers/concerns/pagination.rb
shipit-engine-0.2.1 app/controllers/concerns/pagination.rb
shipit-engine-0.2.0 app/controllers/concerns/pagination.rb