mercredi 6 mai 2015

how to check for an attribute in an array in ruby

I need to find whether a specific attribute is present or not with where statement that takes an array in ruby.

I tried like the below.

User.where(id: [1,2,3]).include?('address')

Aucun commentaire:

Enregistrer un commentaire