Question : ruby sort an object
Answered by : lior
objects.sort_by {|obj| obj.attribute}
# OR
objects.sort_by(&:attribute)
Source : | Last Update : Sat, 20 Mar 21
Answered by : lior
objects.sort_by {|obj| obj.attribute}
# OR
objects.sort_by(&:attribute)
Source : | Last Update : Sat, 20 Mar 21