I have a "Q&A" array and each element is a subarray of three elements (Q, A and Animal). How can I select all the unique animals?
I can select the animals alone with:
[@q_and_a[0][2]] + [@q_and_a[1][2]] + [@q_and_a[2][2]] +[@q_and_a[3][2]]
# => ["Elephant", "Elephant", "Spider", "Spider"]
#pluckmethod:animals = QnAModel.pluck(:animal).uniq. I know it's not what you are looking for, but many might be. Se also: stackoverflow.com/a/9872725/741850