]> projects.mako.cc - selectricity/blob - app/models/ranking.rb
Added some minor TODO's for increased user funcitonality. Change email, beautify...
[selectricity] / app / models / ranking.rb
1 # Selectricity: Voting Machinery for the Masses
2 # Copyright (C) 2007, 2008 Benjamin Mako Hill <mako@atdot.cc>
3 # Copyright (C) 2007 Massachusetts Institute of Technology
4 #
5 # This program is free software. Please see the COPYING file for
6 # details.
7
8 class Ranking < ActiveRecord::Base
9   belongs_to :candidate
10   belongs_to :vote
11   acts_as_list :scope => :vote, :column => :rank
12
13   def <=>(other)
14     self.rank <=> other.rank
15   end
16
17   def to_s
18     self.rank.to_s
19   end
20
21 end

Benjamin Mako Hill || Want to submit a patch?