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