alexreisner/geocoder — pull request #449 by chak (2013-04-23 03:58:11+00:00)
Title: Allow symbol to mean radius comes from a db column

Hi Alex, please take a look at this change. There's probably a way to do it that fits your style better, but this was quick-and-dirty to do what I needed.

The use-case this new feature supports is when each record has its own radius (e.g., a delivery radius) and you want to see if you qualify. Now, if the radius you pass in to .near(...) is a symbol, e.g., :delivery_radius_miles, then that text gets past through to the query as a column name rather than getting interpreted earlier as a float.

There is a side-effect in how I implemented it; even if you pass a numeric value, the calculation is still past down to the database layer with this change.