be828d0e28fac2512df5f004df1b3053ce5fb3c8
[selectricity-live] / app / models / election.rb
1 class Election < ActiveRecord::Base
2   has_many :candidates
3   validates_presence_of :name, :description
4
5   def destroy
6     self.candidates.each do |candidate|
7       candidate.destroy
8     end
9     super destroy
10   end
11   
12 end

Benjamin Mako Hill || Want to submit a patch?