0
喜歡的東西Model.find(array_of_ids, :conditions => {:attribute => "something"})
查找
在那裏我將返回所有條目,其中屬性=什麼的,但只能從ID的數組中。沒有一個ID
喜歡的東西Model.find(array_of_ids, :conditions => {:attribute => "something"})
查找
在那裏我將返回所有條目,其中屬性=什麼的,但只能從ID的數組中。沒有一個ID
Model.where('id in (?)', array_of_ids).where(attribute: "something")
Model.where id: array_of_ids, attribute: 'something'
找不到模型。但是,除去.find()將返回正確的數組。 – aperture
也許這樣? –
Model.where(「id in(?)and attribute =?」,array_of_ids,「something」)似乎有效。 – aperture