I was using an earlier version of geokit plugin on a rails 2.3 app and just updated to this latest version - the one that now uses a gem.
In the previous version it was possible to convert the object returned by the .geocode method to json. by just calling the to_json method on it.
This however breaks in the new version.
I noticed there is an attribute @all in the new GeoLoc which produces a circular reference error if you call to_json on it.
Here is an example of the object returned:
<Geokit::GeoLoc:0x3837be4 @full_address="Phoenix, AZ, USA", @city="Phoenix", @provider="google", @country_code="US", @accuracy=4, @street_address=nil, @lng=-112.073821, @precision="city", @zip=nil, @success=true, @all=[#<Geokit::GeoLoc:0x3837be4...>], @lat=33.448263, @state="AZ">
And here is the error if you call to_json on it:
ActiveSupport::JSON::CircularReferenceError (object references itself)
I am using the "json" to plot markers on the map via jquery. Of course, I can make my own string from the GeoLoc result and convert that to json - but it is more code...
Anyone know why that attribute has been added in the new version and whether there is another way to directly convert the geoLoc result to json?