summaryrefslogtreecommitdiffstats
path: root/app/models/project.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/project.rb')
-rw-r--r--app/models/project.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index 295d3cb05..f58a14bae 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -393,6 +393,15 @@ class Project < ActiveRecord::Base
end
end
+ # Recalculates all lft and rgt values based on project names
+ # Unlike Project.rebuild!, these values are recalculated even if the tree "looks" valid
+ def self.rebuild_tree!
+ transaction do
+ update_all "lft = NULL, rgt = NULL"
+ rebuild!(false)
+ end
+ end
+
# Returns an array of the trackers used by the project and its active sub projects
def rolled_up_trackers
@rolled_up_trackers ||=