Removes calls to child_ids.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/work@2151 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
1 parent
8de41294c0
commit
89ecc00326
2 files changed
+3
-3
No files matched your search
@@ -79,7 +79,7 @@ class Project < ActiveRecord::Base
|
|||||||
def issues_with_subprojects(include_subprojects=false)
|
def issues_with_subprojects(include_subprojects=false)
|
||||||
conditions = nil
|
conditions = nil
|
||||||
if include_subprojects
|
if include_subprojects
|
||||||
ids = [id] + child_ids
|
ids = [id] + descendants.collect(&:id)
|
||||||
conditions = ["#{Project.table_name}.id IN (#{ids.join(',')}) AND #{Project.visible_by}"]
|
conditions = ["#{Project.table_name}.id IN (#{ids.join(',')}) AND #{Project.visible_by}"]
|
||||||
end
|
end
|
||||||
conditions ||= ["#{Project.table_name}.id = ?", id]
|
conditions ||= ["#{Project.table_name}.id = ?", id]
|
||||||
|
|||||||
@@ -268,10 +268,10 @@ class Query < ActiveRecord::Base
|
|||||||
# main project only
|
# main project only
|
||||||
else
|
else
|
||||||
# all subprojects
|
# all subprojects
|
||||||
ids += project.child_ids
|
ids += project.descendants.collect(&:id)
|
||||||
end
|
end
|
||||||
elsif Setting.display_subprojects_issues?
|
elsif Setting.display_subprojects_issues?
|
||||||
ids += project.child_ids
|
ids += project.descendants.collect(&:id)
|
||||||
end
|
end
|
||||||
project_clauses << "#{Project.table_name}.id IN (%s)" % ids.join(',')
|
project_clauses << "#{Project.table_name}.id IN (%s)" % ids.join(',')
|
||||||
elsif project
|
elsif project
|
||||||
|
|||||||
Reference in new issue
Block a user