X-Git-Url: https://projects.mako.cc/source/selectricity-live/blobdiff_plain/2ba40f97b78f529984ff26c7c7d61c91d213e7b0..2e1631b34a5ff16ba9afd794499d95fba5dfa56f:/app/models/candidate.rb?ds=sidebyside diff --git a/app/models/candidate.rb b/app/models/candidate.rb old mode 100644 new mode 100755 index 7af978a..430b6ab --- 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