From: John Dong Date: Thu, 16 Aug 2007 19:35:39 +0000 (-0400) Subject: Validate that quickvote name is not an integer -- causes URL clash X-Git-Url: https://projects.mako.cc/source/selectricity-live/commitdiff_plain/86a510847ee3074727ec8c0e814cb957c40ef0d4 Validate that quickvote name is not an integer -- causes URL clash --- 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.")