projects
/
selectricity
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
* Changed XMLRPC API to use arrays of ID's to report results
[selectricity]
/
app
/
models
/
candidate.rb
diff --git
a/app/models/candidate.rb
b/app/models/candidate.rb
index 7af978afb3f95e422d035b780f4e4519f7fb8021..430b6ab22762223a728eaf6cc27bb3d51f7b8d2e 100644
(file)
--- a/
app/models/candidate.rb
+++ b/
app/models/candidate.rb
@@
-1,6
+1,8
@@
class Candidate < ActiveRecord::Base
belongs_to :election
- validates_uniqueness_of :name
+ validates_presence_of :name
+
+ # validate uniqueness of a name *within a given election*
def <=>(other)
self.name <=> other.name
Benjamin Mako Hill
||
Want to submit a patch?