X-Git-Url: https://projects.mako.cc/source/selectricity-live/blobdiff_plain/9abed97635edbac7fb1a687298fff5c5434cdff4..ac5e3489e8b886b7b8a7252ab56ddeb3d3bdadc7:/app/models/ranking.rb diff --git a/app/models/ranking.rb b/app/models/ranking.rb index f24f0f9..ba021a9 100644 --- a/app/models/ranking.rb +++ b/app/models/ranking.rb @@ -1,4 +1,13 @@ 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