X-Git-Url: https://projects.mako.cc/source/selectricity/blobdiff_plain/ab4adc70d731a74110ea284e8747a4315a946c36..d54ad8e9ed307bf42fd325775fd2b350802847b3:/app/controllers/quickvote_controller.rb diff --git a/app/controllers/quickvote_controller.rb b/app/controllers/quickvote_controller.rb index 5bf259c..eef3402 100644 --- a/app/controllers/quickvote_controller.rb +++ b/app/controllers/quickvote_controller.rb @@ -169,8 +169,8 @@ class QuickvoteController < ApplicationController @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