diff --git a/nested_projects/app/models/project.rb b/nested_projects/app/models/project.rb index 5db7ffca2..56929bdf0 100644 --- a/nested_projects/app/models/project.rb +++ b/nested_projects/app/models/project.rb @@ -79,7 +79,7 @@ class Project < ActiveRecord::Base def issues_with_subprojects(include_subprojects=false) conditions = nil if include_subprojects - ids = [id] + child_ids + ids = [id] + descendants.collect(&:id) conditions = ["#{Project.table_name}.id IN (#{ids.join(',')}) AND #{Project.visible_by}"] end conditions ||= ["#{Project.table_name}.id = ?", id] diff --git a/nested_projects/app/models/query.rb b/nested_projects/app/models/query.rb index 1a4845975..829cda43c 100644 --- a/nested_projects/app/models/query.rb +++ b/nested_projects/app/models/query.rb @@ -268,10 +268,10 @@ class Query < ActiveRecord::Base # main project only else # all subprojects - ids += project.child_ids + ids += project.descendants.collect(&:id) end elsif Setting.display_subprojects_issues? - ids += project.child_ids + ids += project.descendants.collect(&:id) end project_clauses << "#{Project.table_name}.id IN (%s)" % ids.join(',') elsif project