🕵️♀️ Task
The .order
method lets you sort your collection of records by one or more columns. .order
can accept a Hash
, String
, or Arel
as an argument.
Most commonly, we pass a Hash
argument where the keys are the columns you want to sort by, and the value are either :asc
(for ascending order) or :desc
(for descending order).