So, I'm using geokit-rails and I would like to sort by distance, specifically showing the nearest meals first and descending from there. e.g. 5km, 10km, 15km.
However, for some reason the distance_by method isn't working at all, and the distances are all over the place.
This is how we're using it:
all_venues = Venue.where(
'listed = ? AND packages_count > ?', true, 0
).by_distance(origin: search_location).search(params[:search]) || Venue.where(listed: true).all
Are there any work around methods to use? Or how can I sort from nearest to furthest with geokit-rails?
Thanks!