X-Git-Url: https://projects.mako.cc/source/selectricity/blobdiff_plain/bf1d24c356406d42a28aa8bb35e9bd567eefca9f..eed173db706db097ec48a83059d9879a56e2dd4b:/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