Sha256: 68bd54bdde61f87bd8eb5f8091f4e22dbf2044d89c21a84c8e0484393a2343bc
Contents?: true
Size: 520 Bytes
Versions: 3
Compression:
Stored size: 520 Bytes
Contents
module Neo4j module Paginate def self.included(base) base.send(:include, WillPaginate::Finders::Base) end def wp_query(options, pager, args, &block) #:nodoc: page = pager.current_page || 1 per_page = pager.per_page to = per_page * page from = to - per_page i = 0 res = [] each do |node| res << node.wrapper if i >= from i += 1 break if i >= to end pager.replace res pager.total_entries ||= count end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
neo4j-1.3.1-java | lib/neo4j/paginate.rb |
neo4j-1.3.0-java | lib/neo4j/paginate.rb |
neo4j-1.2.6-java | lib/neo4j/paginate.rb |