Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paginated collection doesn't forward the selector method to underlying object #325

Open
raphaelcm opened this issue Jul 18, 2013 · 1 comment

Comments

@raphaelcm
Copy link

Ruby 1.9.3, Rails 3.2, Mongoid 3.1, will_paginate 3.0.4

I should still be able to use the selector method on a collection, even when I've paginated it, but I can't:

Not paginated, it works fine:

1.9.3p392 :008 > Bonus.top_level.selector
 => {"parent_bonus_id"=>nil}

Paginated, it blows up:

1.9.3p392 :009 > Bonus.top_level.paginate(:per_page => 15).selector
NoMethodError: undefined method `selector' for #<WillPaginate::Collection:0x007fd22ce41a28>
@mislav
Copy link
Owner

mislav commented Jul 19, 2013

Did you require "will_paginate/mongoid" manually before trying to use pagination? Because you should do that; it isn't automatic. Try it and let me know if it's different

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants