Use Project.rebuild_tree! instead of .rebuild! in migration.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10868 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang committed 2012-11-23 17:53:12 +00:00
1 parent 25c63ec747
commit dc68be983a
2 files changed
+2 -1

No files matched your search

+1
View File
@@ -395,6 +395,7 @@ class Project < ActiveRecord::Base
# Recalculates all lft and rgt values based on project names
# Unlike Project.rebuild!, these values are recalculated even if the tree "looks" valid
# Used in BuildProjectsTree migration
def self.rebuild_tree!
transaction do
update_all "lft = NULL, rgt = NULL"