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