diff --git a/lib/geogov/geo_stack.rb b/lib/geogov/geo_stack.rb index b0b1a69..375ea6c 100644 --- a/lib/geogov/geo_stack.rb +++ b/lib/geogov/geo_stack.rb @@ -16,7 +16,7 @@ def calculate_fuzzy_point if self.lat and self.lon return FuzzyPoint.new(self.lat, self.lon, :point) end - + if self.postcode district = postcode.split(" ")[0] district_centre = Geogov.centre_of_district(district) @@ -36,14 +36,13 @@ def calculate_fuzzy_point end def self.new_from_ip(ip_address) - #remote_location = Geogov.remote_location(ip_address) - new() - # do |gs| - # if remote_location - # gs.country = remote_location['country'] - # end - # gs.fuzzy_point = gs.calculate_fuzzy_point - # end + remote_location = Geogov.remote_location(ip_address) + new() do |gs| + if remote_location + gs.country = remote_location['country'] + end + gs.fuzzy_point = gs.calculate_fuzzy_point + end end def self.new_from_hash(hash)