Reputation: 6612
I have an integer column "level". I want to order on level by doing this in the controller:
@leagues = League.all.order('level')
This results in 1, 10, 2, 3 as results, where I would expect 1, 2, 3, 10 as results. How can I solve this?
Upvotes: 0
Views: 1734
Reputation: 10395
Sounds like you created the column as a string in the DB ... if it was a int, you'd get 1, 2, 3, 10 ... at least with MySQL!
Upvotes: 1