]> projects.mako.cc - selectricity-live/blobdiff - app/models/ranking.rb
Reorganized the README file and added a short list of dependencies.
[selectricity-live] / app / models / ranking.rb
old mode 100644 (file)
new mode 100755 (executable)
index 4b96b54..5ef0575
@@ -1,9 +1,14 @@
 class Ranking < ActiveRecord::Base
   belongs_to :candidate
   belongs_to :vote
 class Ranking < ActiveRecord::Base
   belongs_to :candidate
   belongs_to :vote
+  acts_as_list :scope => :vote, :column => :rank
 
   def <=>(other)
     self.rank <=> other.rank
   end
 
 
   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?