I am trying to choose 5 distinct brands from among the cars that belong to my users. My current attempt is below (no approach to selecting at random).
@range = @user.cars.select('DISTINCT brand_id').limit(5)
How might I select these five random distinct brands? Thank you very much.