Created
January 6, 2009 15:18
-
-
Save joshuaclayton/43850 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module WillPaginate | |
module ViewHelpers | |
def will_paginate_with_collection_check(*args) | |
# if args.first.respond_to?(:total_pages) doesn't work if using | |
# with a presenter, since the presenter probably uses method_missing to | |
# delegate method calls to the collection instance variable | |
if (args.first.total_pages rescue false) | |
will_paginate_without_collection_check(*args) | |
end | |
end | |
alias_method_chain :will_paginate, :collection_check | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment