I created a Ruby array (Articles) with an attribute (category) containing repeating preset values (e.g. one of the following: "Drink", "Main", "Side"). As result I'd like to get a list of all unique values of this category attribute.
I thought about something like
Article.all.category.uniq
...but that didn't work. Here's an example array:
[#<Article id: 1, category: "Drink">, #<Article id: 2, category: "Main">, #<Article id: 3, category: "Drink">, #<Article id: 4, category: "Side">, #<Article id: 5, category: "Drink">, ]
the content of the result list I am looking for should be in this case: "Drink", "Main", "Side"