From 86a510847ee3074727ec8c0e814cb957c40ef0d4 Mon Sep 17 00:00:00 2001 From: John Dong Date: Thu, 16 Aug 2007 15:35:39 -0400 Subject: [PATCH] Validate that quickvote name is not an integer -- causes URL clash --- app/models/quick_vote.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/models/quick_vote.rb b/app/models/quick_vote.rb index 0efb574..13e6168 100644 --- a/app/models/quick_vote.rb +++ b/app/models/quick_vote.rb @@ -17,6 +17,9 @@ class QuickVote < Election if name =~ /[^A-Za-z0-9]/ errors.add(:name, "must only include numbers and letters.") end + if name =~ /^[0-9]+$/ + errors.add(:name, "must not be a number") + end if name =~ /^(create|index|confirm|change|results)$/ errors.add(:name, " is a reserved word.") -- 2.39.5