So this is more of an arel question than anything but here's what I am trying to do.
I have three objects lets say, called Items
<Item id: 1, name: 'Book'>
<Item id: 2, name: 'Car'>
<Item id: 3, name: 'Book'>
I want to do a query that will just return only one of each unique "name" attributes.
Something like Item.select('distinct(name), items.*')
This doesn't work though, it still returns all three items.
How can I form this query so that it only returns:
<Item id: 1, name: 'Book'>
<Item id: 2, name: 'Car'>