From 89ecc003263496a7cf6146ae1cbecb983de4895e Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 20 Dec 2008 14:31:44 +0000 Subject: [PATCH] Removes calls to child_ids. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/work@2151 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- nested_projects/app/models/project.rb | 2 +- nested_projects/app/models/query.rb | 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 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