X-Git-Url: https://projects.mako.cc/source/selectricity-live/blobdiff_plain/49997d3063f434e33e64040fdb57ba30f4e4c2a8..ffec26b00fc14b92f82137e1e3c62ce78c93ea24:/app/models/vote.rb?ds=sidebyside diff --git a/app/models/vote.rb b/app/models/vote.rb index f263a75..62944e3 100644 --- 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