Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

trash obsolete pagination implementation

  • Loading branch information...
commit b082f583a89a1b7649a52bef9292a1a1dcdb8e2b 1 parent 28311ad
@mislav authored
Showing with 0 additions and 29 deletions.
  1. +0 −29 lib/mingo/pagination.rb
View
29 lib/mingo/pagination.rb
@@ -1,29 +0,0 @@
-require 'will_paginate/finders/base'
-
-class Mingo
- module Pagination
- def self.extended(base)
- klass = base::Cursor
- unless klass.instance_methods.map(&:to_sym).include? :paginate
- klass.send(:include, PaginatedCursor)
- end
- end
-
- def paginate(options)
- find.paginate(options)
- end
-
- module PaginatedCursor
- include WillPaginate::Finders::Base
-
- def wp_query(options, pager, args)
- self.limit pager.per_page
- self.skip pager.offset
- pager.replace self.to_a
- pager.total_entries = self.count unless pager.total_entries
- end
- end
- end
-
- extend Pagination
-end
Please sign in to comment.
Something went wrong with that request. Please try again.