vendredi 22 juillet 2016

Pluck in a selected object

User.find([1,2,3])

I want to get name only in User model. I don't want to loop in an object so I tried:

User.find([1,2,3]).pluck(:name)

But no luck. How can I do the following scenario using pluck behavior?

Aucun commentaire:

Enregistrer un commentaire