]> projects.mako.cc - selectricity/blobdiff - app/models/election.rb
fixed the string modification function and added support for a titlecase method
[selectricity] / app / models / election.rb
index ba466b4b55928dac2f5291e0513d77b684a8c08d..eaf07276128b3b8b8271646aabc6f936949a9ebb 100644 (file)
@@ -39,5 +39,17 @@ class Election < ActiveRecord::Base
   def activate!
     self.active = 1
   end
   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
 end

Benjamin Mako Hill || Want to submit a patch?