Skip to content
Snippets Groups Projects
Commit 617d1e1b authored by Alex Reisner's avatar Alex Reisner
Browse files

Document recent changes.

parent 0694cd5c
No related branches found
No related tags found
No related merge requests found
......@@ -6,7 +6,8 @@ Major changes to Geocoder for each release. Please see the Git log for complete
Next Release
------------
* Fix: Yandex city (thanks github.com/dblock).
* Add :lookup option to `Geocoder.search` and `geocoded_by` (thanks github.com/Bonias).
* Fix: Yandex city attribute caused exception with certain responses (thanks github.com/dblock).
1.1.9 (2013 Dec 11)
-------------------
......
......@@ -225,6 +225,24 @@ For reverse geocoding you can also specify an alternate name attribute where the
reverse_geocoded_by :latitude, :longitude, :address => :location # ActiveRecord
reverse_geocoded_by :coordinates, :address => :loc # MongoDB
You can also configure a specific lookup for your model which will override the globally-configured lookup, for example:
geocoded_by :address, :lookup => :yandex
You can also specify a proc if you want to choose a lookup based on a specific property of an object, for example you can use specialized lookups for different regions:
geocoded_by :address, :lookup => lambda{ |obj| obj.geocoder_lookup }
def geocoder_lookup
if country_code == "RU"
:yandex
elsif country_code == "CN"
:baidu
else
:google
end
end
Advanced Querying
-----------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment