Optimize issue updates when a version sharing changes.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3135 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2009-12-08 16:22:21 +00:00
parent 517a87f8c5
commit 40e2af7ab9
3 changed files with 10 additions and 6 deletions
+2 -2
View File
@@ -344,8 +344,8 @@ class Issue < ActiveRecord::Base
# fixed_version that is outside of the issue's project hierarchy.
#
# OPTIMIZE: does a full table scan of Issues with a fixed_version.
def self.update_fixed_versions_from_project_hierarchy_change
Issue.all(:conditions => ['fixed_version_id IS NOT NULL'],
def self.update_fixed_versions_from_sharing_change(conditions=nil)
Issue.all(:conditions => merge_conditions('fixed_version_id IS NOT NULL', conditions),
:include => [:project, :fixed_version]
).each do |issue|
next if issue.project.nil? || issue.fixed_version.nil?