Re all,<div><br></div><div>I've found a solution which works for me. It's basically an implementation of the Haversine function for ruby taken from here</div><div><a href="http://www.esawdust.com/blog/gps/files/HaversineFormulaInRuby.html">http://www.esawdust.com/blog/gps/files/HaversineFormulaInRuby.html</a></div>
<div><br></div><div>There is another one I haven't tried here:</div><div><a href="https://github.com/almartin/Ruby-Haversine">https://github.com/almartin/Ruby-Haversine</a></div><div><br></div><div>The only drawback is that I got to fetch all the db records which are around 500 and apply haversine distance to each compared against users's current location (which is provided by the phone).</div>
<div><br></div><div>Thanks everyone for the input! It really helped me find the right direction, or at least reasonable.</div><div><br></div><div>Rama</div>