summaryrefslogtreecommitdiffstats
path: root/vendor
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2011-11-15 19:58:43 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2011-11-15 19:58:43 +0000
commit36728d779df86ab8cdac4e95525d89e33a7b6b5a (patch)
treeb304715acd91884149c73056fb193966fb464180 /vendor
parent594074d91bd44effe6e9b0d8251190afd96b6b7c (diff)
downloadredmine-36728d779df86ab8cdac4e95525d89e33a7b6b5a.tar.gz
redmine-36728d779df86ab8cdac4e95525d89e33a7b6b5a.zip
Adds an option to force nested set rebuild (#9577).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7815 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'vendor')
-rw-r--r--vendor/plugins/awesome_nested_set/lib/awesome_nested_set.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/vendor/plugins/awesome_nested_set/lib/awesome_nested_set.rb b/vendor/plugins/awesome_nested_set/lib/awesome_nested_set.rb
index e50e2a671..e14b9d75f 100644
--- a/vendor/plugins/awesome_nested_set/lib/awesome_nested_set.rb
+++ b/vendor/plugins/awesome_nested_set/lib/awesome_nested_set.rb
@@ -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]