X-Git-Url: https://projects.mako.cc/source/selectricity-live/blobdiff_plain/9abed97635edbac7fb1a687298fff5c5434cdff4..18398bc78aacbb1676d2284cdd32362b30776f4f:/app/models/candidate.rb 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 +