I seeded a database with four different values in the “result” column. They’re supposed to represent dollar values but that’s irrelevant.
10,000; 6,500; 1,000; and 0
In the model, I created this class method
def self.result
order("result DESC")
end
In the controller, I called it
@decisions = Decision.result
In the index, it’s listing them in the following order
6,500;
10,000;
1,000;
0
When I switch DESC to ASC….
def self.result
order("result ASC")
end
it reverses the order
0
1,000;
10,000;
6,500;
What is the data type of that column? If it’s a string then a string starting with 6 is “bigger” than one starting with 1