X-Git-Url: https://projects.mako.cc/source/selectricity-live/blobdiff_plain/fc0a6a8d7ea15bcdb27ebdd58721401c7045c6e0..905cf65f6b3e8acc894c268c3bf729e7b0c76292:/app/models/vote.rb diff --git a/app/models/vote.rb b/app/models/vote.rb old mode 100755 new mode 100644 index f263a75..62944e3 --- a/app/models/vote.rb +++ b/app/models/vote.rb @@ -8,6 +8,8 @@ class Vote < ActiveRecord::Base after_update :save_rankings before_destroy :destroy_rankings + + def to_s votes.join("") end @@ -51,6 +53,11 @@ class Vote < ActiveRecord::Base rankings.each { |ranking| ranking.destroy } end + def settime + self.time = Time.now + self.save + end + def confirm! self.confirmed = 1 self.save