alexreisner/geocoder — Issue #140: Near returning the wrong IDs
Author: simmogs
Created: 2011-11-10 21:10:08+00:00
State: open

Hi there,

I'm in the process of converting from geokit to geocoder, mostly because geocoder seems to be much better supported at the moment. With geokit I was doing something like

Address.some_scope.within(10, some_address)

and it was working fine. I've tried to switch over without success. I've now rewritten it to be...

Address.some_scope.near(some_address, 10)

And the results aren't as expected. If I run Address.some_scope on its own I get...

[#

, #

]

which is fine. But when I add the near scope it reduces the results to 1 (which I'd expect) but the ID has changed. The record is otherwise correct, but the ID is being reported incorrectly.

[#

]

But then if I try to doing anything with the results e.g. results.first.some_method it runs that method against the record with ID 3, not 5.

Baffling! Any help appreciated.

Cheers,
Graeme