Module: Geocoder::Model::ActiveRecord
- Includes:
- Base
- Defined in:
- lib/geocoder/models/active_record.rb
Instance Method Summary collapse
-
#geocoded_by(address_attr, options = {}, &block) ⇒ Object
Set attribute names and include the Geocoder module.
-
#reverse_geocoded_by(latitude_attr, longitude_attr, options = {}, &block) ⇒ Object
Set attribute names and include the Geocoder module.
Methods included from Base
Instance Method Details
#geocoded_by(address_attr, options = {}, &block) ⇒ Object
Set attribute names and include the Geocoder module.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/geocoder/models/active_record.rb', line 11 def geocoded_by(address_attr, = {}, &block) geocoder_init( :geocode => true, :user_address => address_attr, :latitude => [:latitude] || :latitude, :longitude => [:longitude] || :longitude, :geocode_block => block, :units => [:units], :method => [:method], :lookup => [:lookup], :language => [:language], :params => [:params] ) end |
#reverse_geocoded_by(latitude_attr, longitude_attr, options = {}, &block) ⇒ Object
Set attribute names and include the Geocoder module.
29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/geocoder/models/active_record.rb', line 29 def reverse_geocoded_by(latitude_attr, longitude_attr, = {}, &block) geocoder_init( :reverse_geocode => true, :fetched_address => [:address] || :address, :latitude => latitude_attr, :longitude => longitude_attr, :reverse_block => block, :units => [:units], :method => [:method], :lookup => [:lookup], :language => [:language], :params => [:params] ) end |