alexreisner/geocoder — Issue #199: Model.near fails when it returns no results and table has no 'id' column
Author: zetetic
Created: 2012-03-10 03:34:08+00:00
State: open

see also https://github.com/alexreisner/geocoder/issues/75

When 'near' is called and the geocoded search returns nothing (e.g., an invalid zipcode), the scope is killed with where(:id => false). This won't work when the model's table has no 'id' column.

Prior to the fix introduced by commit 2707eca we could address this by tacking on 'where("false")'. This works for MySQL, at least.