From 91f41ab40bb4f7508ba7b09e128fa7f0029e1523 Mon Sep 17 00:00:00 2001 From: John Dong Date: Thu, 16 Aug 2007 15:45:16 -0400 Subject: [PATCH] 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 --- app/controllers/quickvote_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.39.5