Skip to content

Commit e6f9f84

Browse files
committed
Merge branch 'master' of github.com:ClosureTree/closure_tree
2 parents 44d9b43 + 866b067 commit e6f9f84

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Closure Tree
22

3+
__Important: please [vote on the future of ClosureTree](https://github.com/mceachen/closure_tree/issues/277)!__
4+
35
### Closure_tree lets your ActiveRecord models act as nodes in a [tree data structure](http://en.wikipedia.org/wiki/Tree_%28data_structure%29)
46

57
Common applications include modeling hierarchical data, like tags, threaded comments, page graphs in CMSes,

lib/closure_tree/numeric_order_support.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ def reorder_with_parent_id(parent_id, minimum_sort_order_value = nil)
4444
FROM #{quoted_table_name}
4545
WHERE #{where_eq(parent_column_name, parent_id)} #{min_where}
4646
) AS t
47-
WHERE #{quoted_table_name}.#{quoted_id_column_name} = t.id
47+
WHERE #{quoted_table_name}.#{quoted_id_column_name} = t.id and
48+
#{quoted_table_name}.#{quoted_order_column(false)} is distinct from t.seq + #{minimum_sort_order_value.to_i - 1}
4849
SQL
4950
end
5051

0 commit comments

Comments
 (0)