X-Git-Url: https://projects.mako.cc/source/selectricity/blobdiff_plain/9abed97635edbac7fb1a687298fff5c5434cdff4..5c62b1606f7f89efdd5a6c51308cd0212fe9a709:/app/models/candidate.rb?ds=sidebyside diff --git a/app/models/candidate.rb b/app/models/candidate.rb index a0e492e..6048562 100644 --- a/app/models/candidate.rb +++ b/app/models/candidate.rb @@ -1,8 +1,24 @@ +# Selectricity: Voting Machinery for the Masses +# Copyright (C) 2007, 2008 Benjamin Mako Hill +# Copyright (C) 2007 Massachusetts Institute of Technology +# +# This program is free software. Please see the COPYING file for +# details. + class Candidate < ActiveRecord::Base belongs_to :election + has_one :picture + validates_presence_of :name + + # validate uniqueness of a name *within a given election* def <=>(other) - self.name <=> other.name + self.name <=> other.name + end + + def to_s + name end end +