File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ module Model
13
13
touch : _ct . options [ :touch ] ,
14
14
optional : true )
15
15
16
- order_by_generations = "#{ _ct . quoted_hierarchy_table_name } .generations asc"
16
+ order_by_generations = Arel . sql ( "#{ _ct . quoted_hierarchy_table_name } .generations ASC" )
17
17
18
18
has_many :children , *_ct . has_many_with_order_option (
19
19
class_name : _ct . model_class . to_s ,
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ def _ct_sum_order_by(node = nil)
65
65
node_score = "(1 + anc.#{ _ct . quoted_order_column ( false ) } ) * " +
66
66
"power(#{ h [ 'total_descendants' ] } , #{ h [ 'max_depth' ] . to_i + 1 } - #{ depth_column } )"
67
67
68
- "sum (#{ node_score } )"
68
+ Arel . sql ( "SUM (#{ node_score } )")
69
69
end
70
70
71
71
def roots_and_descendants_preordered
You can’t perform that action at this time.
0 commit comments