I have a simple array
my_array = [{id:1,priority_score:2},{id:3,priority_score:5},{id:4,priority_score:3.5}...]
I am trying to sort by the priority score with
sort_array = my_array.sort_by{|priority| priority[:priority_score]}
strangely, I am not getting a back any difference from my original array.
I create the priority score using
new_hash = {id:h.id,priority_score:(a.score+b.score)/2}
and have added all sorts of .to_f,.to_i in case the problem was that the priority score was not being recognized as a number, but that isn't the problem.
Any suggestions?