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