From: Date: Wed, 5 Sep 2007 19:21:31 +0000 (-0400) Subject: fixed rendering error with css X-Git-Url: https://projects.mako.cc/source/selectricity-live/commitdiff_plain/d857bfeff0568003715939fab8aa2925261272a6?hp=ca25ff5b7d32b8c3d94dfcbad2e9c3a3cbe21280 fixed rendering error with css --- 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 diff --git a/app/models/election.rb b/app/models/election.rb index 99d64f9..cd809ab 100644 --- a/app/models/election.rb +++ b/app/models/election.rb @@ -91,14 +91,14 @@ class Election < ActiveRecord::Base #Calculate results if not in memcache def results # Assignment is intentional - if Cache and c = Cache.get("election_results:#{id}:#{self.votes.length}") + if defined? Cache and c = Cache.get("election_results:#{id}:#{self.votes.length}") @plurality_result = c['plurality'] @approval_result = c['approval'] @condorcet_result = c['condorcet'] @ssd_result = c['ssd'] @borda_result = c['borda'] return c - elsif Cache + elsif defined? Cache # memcache is available, but missed. results = self.results! Cache.set("election_results:#{id}:#{self.votes.length}", results) diff --git a/app/views/quickvote/list_voters.rhtml b/app/views/quickvote/list_voters.rhtml index cdfc049..b0dc6dd 100644 --- a/app/views/quickvote/list_voters.rhtml +++ b/app/views/quickvote/list_voters.rhtml @@ -27,8 +27,8 @@ voter.ipaddress =~ /^172\.[1-3]/ %> <% w=nil - if Cache and w=Cache.get("WHOIS:#{voter.ipaddress}") - elsif Cache + if defined? Cache and w=Cache.get("WHOIS:#{voter.ipaddress}") + elsif defined? Cache w= Whois::Whois.new(IPAddr.new(voter.ipaddress),true) w.search_whois Cache.set("WHOIS:#{voter.ipaddress}", w) diff --git a/config/environments/production.rb b/config/environments/production.rb index 3192ef5..d1b8f88 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -1,8 +1,8 @@ # Settings specified here will take precedence over those in config/environment.rb # #Enable memcache -require('memcache') -Cache=MemCache.new('localhost', :compression => true) +#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 diff --git a/vendor/plugins/ym4r_gm/gmaps_api_key.yml b/vendor/plugins/ym4r_gm/gmaps_api_key.yml index c9a004c..b001f22 100644 --- a/vendor/plugins/ym4r_gm/gmaps_api_key.yml +++ b/vendor/plugins/ym4r_gm/gmaps_api_key.yml @@ -3,5 +3,4 @@ #For development and test, we have only one possible host (localhost:3000), so there is only a single key associated with the mode. #In production, the app can be accessed through 2 different hosts: thepochisuperstarmegashow.com and exmaple.com. There then needs a 2-key hash. If you deployed to one host, only the API key would be needed (as in development and test). -development: -ABQIAAAA479zRK1hoNqMcKLTMuBcTRScPKE_l4RVNk_lv74wWGSk9YyVlRQ16fPZdTl-PBiKfGdEjSpSL8gVtA +development: ABQIAAAAgF6Bji0Bp0aem4-FFAfR2xTtWi90b3gTbCFfFrv8yOIB0t7PrBRtYF3ygN-BlaUxJZFk3x0L7L_oMw