Permalink
Browse files

just a bit of cleaning

  • Loading branch information...
1 parent 0f0a28e commit 86cc7f1beeb56d8afe94bb15bdb6ee4af2ea1a1f Adam Weller committed Apr 2, 2010
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/geokit-rails/ip_geocode_lookup.rb
@@ -27,9 +27,10 @@ def geocode_ip_address(filter_options = {})
def store_ip_location
session[:geo_location] ||= retrieve_location_from_cookie_or_service
geo_location = session[:geo_location]
+ return unless geo_location
geo_location = geo_location.to_hash unless geo_location.is_a?(Hash)
- cookies[:geo_location] = { :value => geo_location.to_yaml, :expires => 30.days.from_now } if geo_location
- end
+ cookies[:geo_location] = { :value => geo_location.to_yaml, :expires => 30.days.from_now }
+ end
# Uses the stored location value from the cookie if it exists. If
# no cookie exists, calls out to the web service to get the location.

0 comments on commit 86cc7f1

Please sign in to comment.