Closed rdetert closed 12 years ago
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
You are using the wrong method.
GeoNear will always sort by distance.
River.where(:source.near => {:point => [-73.98, 40.77], :max => 5})
is the filter
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