Skip to content

Commit 6fc88c9

Browse files
author
Morus Walter
committed
avoid update of records that do not change
1 parent 24c0077 commit 6fc88c9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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)