I have a list of Active-record objects with multiple columns including brands.
[#<UsedCar id: 861214,  city_id: 4, place_id: 1, description: "abc",brand: "Toyota">,#<UsedCar id: 861214,  city_id: 4, place_id: 1, description: "abc",brand: "Honda">,#<UsedCar id: 861214,  city_id: 4, place_id: 1, description: "abc",brand: "Jeep">,#<UsedCar id: 861214,  city_id: 4, place_id: 1, description: "abc",brand: "Opel">,]
And another array of just brands
brands = %w[Toyota, Nissan, Lexus, Kia, Mazda, Honda, BMW, Range Rover, Chevrolet, Mitsubishi]
I want to to order the objects list as per the brands array ordering but not find any way by using sort_by or sort or group_by
 
     
     
    