before_validation :build_candidate_names
after_validation :create_candidates
validates_uniqueness_of :name
- validates_presence_of :name
attr_accessor :candidate_names
attr_accessor :reviewed
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 validate