mongoid 3.1 geo_near pagination fails #375

Closed
robj opened this Issue Apr 2, 2013 · 1 comment

Comments

Projects
None yet
2 participants
@robj

robj commented Apr 2, 2013

User.geo_near([ current_user.lat, current_user.lng ]).page(params[:page]).per(per_page)
# => NoMethodError - undefined method `page' for #<Mongoid::Contextual::GeoNear:0x007fe02c63bff0>:
@yuki24

This comment has been minimized.

Show comment Hide comment
@yuki24

yuki24 Apr 29, 2013

Owner

Does this work for you?

User.page(params[:page]).per(per_page).geo_near([ current_user.lat, current_user.lng ])

I'm not sure if it works but feel free to send a pull request!

Owner

yuki24 commented Apr 29, 2013

Does this work for you?

User.page(params[:page]).per(per_page).geo_near([ current_user.lat, current_user.lng ])

I'm not sure if it works but feel free to send a pull request!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment