X-Git-Url: https://projects.mako.cc/source/selectricity-live/blobdiff_plain/75091532075247ae9c47164ea883f4fe803eddf4..3096416bbb8fdc92d7619aecc8237a57532d9066:/app/models/election.rb diff --git a/app/models/election.rb b/app/models/election.rb index 0860a42..eaf0727 100644 --- a/app/models/election.rb +++ b/app/models/election.rb @@ -44,4 +44,12 @@ class Election < ActiveRecord::Base 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