X-Git-Url: https://projects.mako.cc/source/selectricity/blobdiff_plain/d207da8dfc3f315f7758d1f5307c700ce4c25156..eaf661eb6a8571bc24b180cfc731f3b9b38a8fff:/app/models/quick_vote.rb?ds=sidebyside diff --git a/app/models/quick_vote.rb b/app/models/quick_vote.rb old mode 100644 new mode 100755 index d6ab55b..98379cb --- a/app/models/quick_vote.rb +++ b/app/models/quick_vote.rb @@ -16,17 +16,14 @@ class QuickVote < Election def initialize(params={}) super - self.enddate = DateTime.now + 30 + self.enddate = Time.now + 30.days self.active = 1 self.anonymous = 1 + self.quickvote = 1 end - def candidatelist=(candstring='') - @raw_candidates = candstring.split(';').collect {|cand| cand.strip } - end - - def candidatelist - @raw_candidates.join("; ") + def candidatelist=(candlist) + @raw_candidates = candlist end def name @@ -34,17 +31,12 @@ class QuickVote < Election end def reviewed? - if reviewed.to_i == 1 - return true - else - false - end + reviewed.to_i == 1 end def create_candidates @raw_candidates.each do |name| candidate = Candidate.new({:name => name}) - candidate.save self.candidates << candidate end end