Ну, я думаю, вы можете просто использовать :order => 'sum_deal_price ASC'
в вызове sum
исходного ответа.
Но вы также можете сделать это в Ruby, это немного сложнее:
# You can't sort a Hash directly, so turn it into an Array.
arr = var.to_a # => [[2, "534.45"], [7, "10"], [153, "85.0"]]
# Looks like there's a bunch of floats-as-strings in there, fix that.
arr.map! { |pair| [pair.first, pair.second.to_f] }
# Now sort it by the value (which is the second entry of the pair).
arr.sort! { |a, b| a.second <=> b.second }
# Turn it back into an OrderedHash.
sorted_hash = ActiveSupport::OrderedHash[arr]