projects
/
selectricity-live
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Merge from jdong
[selectricity-live]
/
app
/
models
/
ranking.rb
diff --git
a/app/models/ranking.rb
b/app/models/ranking.rb
index f24f0f913dc8b33c7b0423e17701718f4c09943c..5ef0575adc1a9525a41dc6468c3406aad1132974 100644
(file)
--- a/
app/models/ranking.rb
+++ b/
app/models/ranking.rb
@@
-1,4
+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
Benjamin Mako Hill
||
Want to submit a patch?