Sha256: d5874c99fa69df11cf4165b780358aaa79805c451085baed8478e76073abea82
Contents?: true
Size: 688 Bytes
Versions: 7
Compression:
Stored size: 688 Bytes
Contents
require 'kaminari/models/mongoid_criteria_methods' module Kaminari module MongoidExtension module Document extend ActiveSupport::Concern include Kaminari::ConfigurationMethods included do scope Kaminari.config.page_method_name, Proc.new {|num| limit(default_per_page).offset(default_per_page * ((num = num.to_i - 1) < 0 ? 0 : num)) } do include Kaminari::MongoidCriteriaMethods include Kaminari::PageScopeMethods end end module ClassMethods def inherited(kls) super kls.send(:include, Kaminari::MongoidExtension::Document.dup) end end end end end
Version data entries
7 entries across 7 versions & 5 rubygems