Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
就像是Model.find(array_of_ids, :conditions => {:attribute => "something"})
Model.find(array_of_ids, :conditions => {:attribute => "something"})
我将在其中返回属性 = 某物的所有条目,但仅来自该 ID 数组。
Model.where id: array_of_ids, attribute: 'something'
Model.where('id in (?)', array_of_ids).where(attribute: "something")