else
# record the ip address for posterity
- @voter.ipaddress = request.env["REMOTE_ADDR"]
+ @voter.ipaddress = request.env["HTTP_X_FORWARDED_FOR"]
@voter.save
# toggle the confirmation bit
@election=QuickVote.ident_to_quickvote(params[:id])
@election.voters.each do |voter|
next unless voter.ipaddress
+
location=nil
- if defined? Cache and location=Cache.get("GEO:#{voter.ipaddress}")
- elsif defined? Cache
+ if Cache and location=Cache.get("GEO:#{voter.ipaddress}")
+ elsif Cache
location = GeoKit::Geocoders::IpGeocoder.geocode(voter.ipaddress)
Cache.set "GEO:#{voter.ipaddress}", location
else
# Settings specified here will take precedence over those in config/environment.rb
#disable memcache
Cache=nil
+
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the webserver when you make code changes.
# Settings specified here will take precedence over those in config/environment.rb
#
#Enable memcache
-#require('memcache')
-#Cache=MemCache.new('localhost', :compression => true)
-Cache=nil
+require('memcache')
+Cache=MemCache.new('localhost', :compression => true)
+
# The production environment is meant for finished, "live" apps.
# Code is not reloaded between requests
config.cache_classes = true
# Settings specified here will take precedence over those in config/environment.rb
#disable memcache
Cache=nil
+
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped