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
1313 touch : _ct . options [ :touch ] ,
1414 optional : true )
1515
16- order_by_generations = "#{ _ct . quoted_hierarchy_table_name } .generations asc"
16+ order_by_generations = Arel . sql ( "#{ _ct . quoted_hierarchy_table_name } .generations ASC" )
1717
1818 has_many :children , *_ct . has_many_with_order_option (
1919 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)
6565 node_score = "(1 + anc.#{ _ct . quoted_order_column ( false ) } ) * " +
6666 "power(#{ h [ 'total_descendants' ] } , #{ h [ 'max_depth' ] . to_i + 1 } - #{ depth_column } )"
6767
68- "sum (#{ node_score } )"
68+ Arel . sql ( "SUM (#{ node_score } )")
6969 end
7070
7171 def roots_and_descendants_preordered
You can’t perform that action at this time.
0 commit comments