@election.voters.each do |voter|
next unless voter.ipaddress
location=nil
- if Cache and location=Cache.get("GEO:#{voter.ipaddress}")
- elsif Cache
+ if defined? Cache and location=Cache.get("GEO:#{voter.ipaddress}")
+ elsif defined? Cache
location = GeoKit::Geocoders::IpGeocoder.geocode(voter.ipaddress)
Cache.set "GEO:#{voter.ipaddress}", location
else