]> projects.mako.cc - selectricity-live/blobdiff - app/models/ranking.rb
Made a large number of mostly cosmetic fixes after a detailed
[selectricity-live] / app / models / ranking.rb
index f24f0f913dc8b33c7b0423e17701718f4c09943c..ba021a92c5489369e75b92094ffe549ccf5c1730 100644 (file)
@@ -1,4 +1,13 @@
 class Ranking < ActiveRecord::Base
   belongs_to :candidate
   belongs_to :vote
 class Ranking < ActiveRecord::Base
   belongs_to :candidate
   belongs_to :vote
+
+  def <=>(other)
+    self.rank <=> other.rank
+  end
+
+  def to_s
+    self.rank.to_s
+  end
+
 end
 end

Benjamin Mako Hill || Want to submit a patch?