Skip to content

Commit a15ceb8

Browse files
author
Eliezer Reis
committed
fix(closure_tree/numeric_order_support.rb): fix order by clause to use the fully qualified column name
1 parent 283e898 commit a15ceb8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/closure_tree/numeric_order_support.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def reorder_with_parent_id(parent_id, minimum_sort_order_value = nil)
4242
UPDATE #{quoted_table_name}
4343
SET #{quoted_order_column(false)} = t.seq + #{minimum_sort_order_value.to_i - 1}
4444
FROM (
45-
SELECT #{quoted_id_column_name} AS id, row_number() OVER(ORDER BY #{order_by}) AS seq
45+
SELECT #{quoted_id_column_name} AS id, row_number() OVER(ORDER BY #{fully_qualified_order_by}) AS seq
4646
FROM #{quoted_table_name}
4747
WHERE #{where_eq(parent_column_name, parent_id)} #{min_where}
4848
) AS t

0 commit comments

Comments
 (0)