##// END OF EJS Templates
Use Project.rebuild_tree! instead of .rebuild! in migration....
Jean-Philippe Lang -
r10641:dc68be983a41
parent child
Show More
@@ -395,6 +395,7 class Project < ActiveRecord::Base
395
395
396 # Recalculates all lft and rgt values based on project names
396 # Recalculates all lft and rgt values based on project names
397 # Unlike Project.rebuild!, these values are recalculated even if the tree "looks" valid
397 # Unlike Project.rebuild!, these values are recalculated even if the tree "looks" valid
398 # Used in BuildProjectsTree migration
398 def self.rebuild_tree!
399 def self.rebuild_tree!
399 transaction do
400 transaction do
400 update_all "lft = NULL, rgt = NULL"
401 update_all "lft = NULL, rgt = NULL"
@@ -1,6 +1,6
1 class BuildProjectsTree < ActiveRecord::Migration
1 class BuildProjectsTree < ActiveRecord::Migration
2 def self.up
2 def self.up
3 Project.rebuild!(false)
3 Project.rebuild_tree!
4 end
4 end
5
5
6 def self.down
6 def self.down
General Comments 0
You need to be logged in to leave comments. Login now