やり方
User.select("name, ABS(point) AS point_abs").order(:point_abs :desc)
データ内容補足
並び替え前
User name point
1 neko 10
2 dog -20
3 usagi 30
絶対値での並び替え後
User name point_abs
3 usagi 30
2 dog -20
1 neko 10
注意点
ActiveRecord::Relation上、列別名付けたカラムが表示されなくなる
User.select("name, ABS(point) AS point_abs").order(:point_abs :desc)
=> #<ActiveRecord::Relation[
#<User id: 3, name: "usagi">,
#<User id: 2, name: "dog">,
#<User id: 1, name: "neko">]>
でもちゃんと項目としては存在している
User.select("name, ABS(point) AS point_abs").order(:point_abs :desc).to_a.first.point_abs
=> 30