X-Git-Url: https://projects.mako.cc/source/selectricity/blobdiff_plain/c5fda1e5174238779afd496014379d6446d1e3c1..e8094b780ec0f30ac06b4de4c4f3a9c2bffe209d:/app/models/ranking.rb diff --git a/app/models/ranking.rb b/app/models/ranking.rb index 4b96b54..5ef0575 100644 --- a/app/models/ranking.rb +++ b/app/models/ranking.rb @@ -1,9 +1,14 @@ 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 to_s + self.rank.to_s + end + end