summaryrefslogtreecommitdiffstats
path: root/lib/plugins
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2014-01-20 13:35:05 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2014-01-20 13:35:05 +0000
commit89c43d24c82f6b58e8838bb92ddf6808cef6828c (patch)
treed5ba20982ec5804f6c1ea36068139513f85b40e8 /lib/plugins
parent1c0c22de170ebecf9570fe36af0a3fba0ea2b496 (diff)
downloadredmine-89c43d24c82f6b58e8838bb92ddf6808cef6828c.tar.gz
redmine-89c43d24c82f6b58e8838bb92ddf6808cef6828c.zip
back out r12680
<pre> 1) Failure: test_children(ProjectTest) [test/unit/project_test.rb:374]: <[5, 3, 4]> expected but was <[3, 4, 5]>. </pre> git-svn-id: http://svn.redmine.org/redmine/trunk@12681 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/plugins')
-rw-r--r--lib/plugins/awesome_nested_set/lib/awesome_nested_set/awesome_nested_set.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/plugins/awesome_nested_set/lib/awesome_nested_set/awesome_nested_set.rb b/lib/plugins/awesome_nested_set/lib/awesome_nested_set/awesome_nested_set.rb
index ff86d7feb..1a7ceae15 100644
--- a/lib/plugins/awesome_nested_set/lib/awesome_nested_set/awesome_nested_set.rb
+++ b/lib/plugins/awesome_nested_set/lib/awesome_nested_set/awesome_nested_set.rb
@@ -198,16 +198,17 @@ module CollectiveIdea #:nodoc:
# set left
node[left_column_name] = indices[scope.call(node)] += 1
# find
- where(["#{quoted_parent_column_full_name} = ? #{scope.call(node)}", node]).order("#{quoted_left_column_full_name}, #{quoted_right_column_full_name}, id").each{|n| set_left_and_rights.call(n) }
+ where(["#{quoted_parent_column_name} = ? #{scope.call(node)}", node]).
+ order(acts_as_nested_set_options[:order]).
+ each{|n| set_left_and_rights.call(n) }
# set right
node[right_column_name] = indices[scope.call(node)] += 1
node.save!(:validate => validate_nodes)
end
# Find root node(s)
- root_nodes = where("#{quoted_parent_column_full_name} IS NULL").
- order(acts_as_nested_set_options[:order_column]).
- each do |root_node|
+ root_nodes = where("#{quoted_parent_column_name} IS NULL").
+ order(acts_as_nested_set_options[:order]).each do |root_node|
# setup index for this scope
indices[scope.call(root_node)] ||= 0
set_left_and_rights.call(root_node)