- def candidatelist=(candstring='')
- @raw_candidates = candstring.split(';').collect {|cand| cand.strip }
+ errors.add(nil, "Candidates must all be unique") if @raw_candidates and @raw_candidates.uniq!
+
+ 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.")
+ end