Closed marcandre closed 9 years ago
Oups, fixed.
I first tried using reverse_order
but it fails on this order clause, so I modified slightly by_distance
to accept a reverse
option.
Note that this fixes another issue with farthest
, namely that last(1)
was loading all matching records with to_a
, so it could be really really slow.
I hope to fix these two issues in Rails, but it involves a sql parser of some sort...
Simple PR to avoid returning an array when a scope will provide even more flexibility.
Note: the old
geokit-rails3
was doing this too, so it's a compatibility issue also.