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 2012-11-23 17:53:12 +00:00
parent 25c63ec747
commit dc68be983a
2 changed files with 2 additions and 1 deletions

View File

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

View File

@ -1,6 +1,6 @@
class BuildProjectsTree < ActiveRecord::Migration class BuildProjectsTree < ActiveRecord::Migration
def self.up def self.up
Project.rebuild!(false) Project.rebuild_tree!
end end
def self.down def self.down