Sha256: a7437f9c24d367c0e168afea9442cf553cfe6d24361b2d5adc8aa5d7d6dfd788
Contents?: true
Size: 637 Bytes
Versions: 29
Compression:
Stored size: 637 Bytes
Contents
module MongoMapper module Plugins module Pagination module ClassMethods def per_page 25 end def paginate(options) per_page = options.delete(:per_page) || self.per_page page = options.delete(:page) total_entries = count(options) pagination = Pagination::Proxy.new(total_entries, page, per_page) options.update(:limit => pagination.limit, :skip => pagination.skip) pagination.subject = find_many(options) pagination end end end end end require 'mongo_mapper/plugins/pagination/proxy'
Version data entries
29 entries across 29 versions & 5 rubygems