module Geocoder::Orm::Base
def distance_to(lat, lon, units = :mi)
units to be used (:mi or :km; default is :mi).
Takes two floats (latitude, longitude) and a symbol specifying the
Calculate the distance from the object to an arbitrary point.
#
def distance_to(lat, lon, units = :mi) return nil unless geocoded? mylat,mylon = read_coordinates Geocoder::Calculations.distance_between(mylat, mylon, lat, lon, :units => units) end