From 3697ad100753a33ea0c8b83b759f7aa2f46d3d70 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 20 Dec 2008 18:02:29 +0000 Subject: [PATCH] Deleting a project deletes all its descendants. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/work@2157 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- nested_projects/app/models/project.rb | 2 +- nested_projects/app/views/projects/destroy.rhtml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nested_projects/app/models/project.rb b/nested_projects/app/models/project.rb index 6131b3272..8f87295df 100644 --- a/nested_projects/app/models/project.rb +++ b/nested_projects/app/models/project.rb @@ -43,7 +43,7 @@ class Project < ActiveRecord::Base :join_table => "#{table_name_prefix}custom_fields_projects#{table_name_suffix}", :association_foreign_key => 'custom_field_id' - acts_as_nested_set :order => 'name', :dependent => :nullify + acts_as_nested_set :order => 'name', :dependent => :destroy acts_as_attachable :view_permission => :view_files, :delete_permission => :manage_files diff --git a/nested_projects/app/views/projects/destroy.rhtml b/nested_projects/app/views/projects/destroy.rhtml index a1913c115..09d7d2a1c 100644 --- a/nested_projects/app/views/projects/destroy.rhtml +++ b/nested_projects/app/views/projects/destroy.rhtml @@ -3,8 +3,8 @@

<%=h @project_to_destroy %>
<%=l(:text_project_destroy_confirmation)%> -<% if @project_to_destroy.children.any? %> -
<%= l(:text_subprojects_destroy_warning, content_tag('strong', h(@project_to_destroy.children.sort.collect{|p| p.to_s}.join(', ')))) %> +<% if @project_to_destroy.descendants.any? %> +
<%= l(:text_subprojects_destroy_warning, content_tag('strong', h(@project_to_destroy.descendants.collect{|p| p.to_s}.join(', ')))) %> <% end %>