def startdate
read_attribute( :startdate ) || Time.now
end
-
+
def enddate
date = read_attribute( :enddate ) || Time.now + 14
date - 1.second
super(date)
end
+ def votes
+ votes = Array.new
+ self.voters.each do |voter|
+ votes << voter.vote
+ end
+ return votes
+ end
+
def destroy
self.candidates.each do |candidate|
candidate.destroy
end
def quickvote?
- quickvote.to_i == 1
+ type == 'QuickVote'
end
def active?