Class: ZipCode

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/earth/locality/zip_code.rb

Instance Method Summary collapse

Instance Method Details

#set_latitude_and_longitudeObject



16
17
18
19
20
# File 'lib/earth/locality/zip_code.rb', line 16

def set_latitude_and_longitude
  return if latitude.present? and longitude.present?
  a = Geokit::Geocoders::YahooGeocoder.geocode name
  update_attributes! :latitude => a.lat, :longitude => a.lng
end