ryanong/mongoid_spacial — Issue #21: geo_near Sorting
Author: rdetert
Created: 2012-02-22 22:38:03+00:00
State: open

Am I doing something wrong? It seems that I geo_near automatically always sorts by distance. I'd like to be able to sort by other fields:

@appointments = Appointment.desc(:created_at).geo_near(mycity.coords, :max_distance => @distance, :unit => :mi, :spherical => true)

This always sorts by distance, not created_at