attr_accessor :raw_candidates
attr_accessor :reviewed
+ def initialize(params={})
+ super
+ self.startdate = Time.now
+ self.active = 1
+ self.anonymous = 1 unless self.anonymous
+ self.enddate = read_attribute( :enddate ) || \
+ Time.now + 30.days - 1.second
+ end
+
+ def enddate
+ super(30)
+ end
+
def validate
if not @raw_candidates or @raw_candidates.length < 2
errors.add(nil, "You must list at least two candidates.")
errors.add(:name, " is a reserved word.")
end
end
-
- def initialize(params={})
- super
- self.startdate = Time.now
- self.enddate = Time.now + 30.days
- self.active = 1
- self.anonymous = 1
- end
def candidatelist=(candlist)
@raw_candidates = candlist