X-Git-Url: https://projects.mako.cc/source/selectricity/blobdiff_plain/fd484b33a3920e0031007c5c2f1dec61913cbab5..3096416bbb8fdc92d7619aecc8237a57532d9066:/app/models/election.rb?ds=inline diff --git a/app/models/election.rb b/app/models/election.rb index ba466b4..eaf0727 100644 --- a/app/models/election.rb +++ b/app/models/election.rb @@ -39,5 +39,17 @@ class Election < ActiveRecord::Base def activate! self.active = 1 end + + def quickvote? + quickvote.to_i == 1 + end + + def shortdesc + shortdesc = description.split(/\n/)[0] + end + def longdesc + longdesc = description.split(/\n/)[1..-1].join("") + longdesc.length > 0 ? longdesc : nil + end end