Sha256: 320cb4f31200e8357070d1acbca08cf66bc85e939a3089eaea569668cb68d2ac
Contents?: true
Size: 584 Bytes
Versions: 10
Compression:
Stored size: 584 Bytes
Contents
require 'kaminari/models/active_record_relation_methods' module Kaminari module ActiveRecordModelExtension extend ActiveSupport::Concern included do self.send(:include, Kaminari::ConfigurationMethods) # Fetch the values at the specified page number # Model.page(5) self.scope Kaminari.config.page_method_name, Proc.new {|num| limit(default_per_page).offset(default_per_page * ([num.to_i, 1].max - 1)) } do include Kaminari::ActiveRecordRelationMethods include Kaminari::PageScopeMethods end end end end
Version data entries
10 entries across 10 versions & 3 rubygems