GitLab steht wegen Wartungsarbeiten am Montag, den 10. Mai, zwischen 17:00 und 19:00 Uhr nicht zur Verfügung.

Commit 597b0abf authored by jplang's avatar jplang

Adds an option to force nested set rebuild (#9577).

git-svn-id: https://svn.redmine.org/redmine/trunk@7815 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 7696aff1
......@@ -162,9 +162,10 @@ module CollectiveIdea #:nodoc:
end
# Rebuilds the left & rights if unset or invalid. Also very useful for converting from acts_as_tree.
def rebuild!
def rebuild!(force=false)
# Don't rebuild a valid tree.
return true if valid?
# valid? doesn't strictly validate the tree
return true if !force && valid?
scope = lambda{|node|}
if acts_as_nested_set_options[:scope]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment