Index: app/models/project.rb =================================================================== --- app/models/project.rb (revision 3628) +++ app/models/project.rb (working copy) @@ -74,7 +74,7 @@ # reserved words validates_exclusion_of :identifier, :in => %w( new ) - before_destroy :delete_all_members, :destroy_children + before_destroy :delete_all_members named_scope :has_module, lambda { |mod| { :conditions => ["#{Project.table_name}.id IN (SELECT em.project_id FROM #{EnabledModule.table_name} em WHERE em.name=?)", mod.to_s] } } named_scope :active, { :conditions => "#{Project.table_name}.status = #{STATUS_ACTIVE}"} @@ -496,6 +496,12 @@ return nil end end + + # Override ActiveRecord::Base#destroy + def destroy + destroy_children + super + end private