X-Git-Url: https://projects.mako.cc/source/selectricity-live/blobdiff_plain/ab4adc70d731a74110ea284e8747a4315a946c36..eed173db706db097ec48a83059d9879a56e2dd4b:/app/controllers/quickvote_controller.rb?ds=inline 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