From: John Dong Date: Thu, 16 Aug 2007 19:45:16 +0000 (-0400) Subject: Disallow identical candidates to be added to a quickvote. Differently cased identical... X-Git-Url: https://projects.mako.cc/source/selectricity-live/commitdiff_plain/91f41ab40bb4f7508ba7b09e128fa7f0029e1523 Disallow identical candidates to be added to a quickvote. Differently cased identical strings are still allowed. This of course makes Asdf and asdf impossible to tell apart in the vote, which is kind of a bug. We should think of some way of differentiating those --- diff --git a/app/controllers/quickvote_controller.rb b/app/controllers/quickvote_controller.rb index 2847df9..a365171 100644 --- a/app/controllers/quickvote_controller.rb +++ b/app/controllers/quickvote_controller.rb @@ -37,7 +37,7 @@ class QuickvoteController < ApplicationController candidate_name = CGI.escapeHTML(params[:ajax][:newcandidate]) unless candidate_name.strip.empty? if flash.has_key?(:candlist) and flash[:candlist].instance_of?(Array) - flash[:candlist] << candidate_name + flash[:candlist] << candidate_name unless flash[:candlist].index(candidate_name) else flash[:candlist] = [ candidate_name ] end