Skip to content

Commit

Permalink
Merge pull request mislav#1 from fortnightlabs/mongoid
Browse files Browse the repository at this point in the history
A few more methods from `WillPaginate::CollectionMethods`
  • Loading branch information
dbackeus committed Mar 5, 2012
2 parents 4438f09 + 78037cc commit 29977a6
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/will_paginate/mongoid.rb
Expand Up @@ -22,16 +22,13 @@ def page(page)
end

module CollectionMethods
include WillPaginate::CollectionMethods
attr_reader :current_page

def total_entries
@total_entries ||= count
end

def total_pages
(total_entries / per_page.to_f).ceil
end

def offset
@page_multiplier * per_page
end
Expand Down

0 comments on commit 29977a6

Please sign in to comment.