只是一个问题,array = [19, 5, 1, 4] 当我调用 where 来Delivery.where(id: array.map(&:id))具有活动记录关系而不是数组时,我有一个带有一些 id 的数组, \xe2\x80\x9cwhere\xe2\x80\x9d 语句正在对 id 进行排序并给我所有按 id 排序的对象:\n #<ActiveRecord::Relation [#<Delivery id: 1, ... >, #<Delivery id: 4, ... >, #<Delivery id: 5, ... >, #<Delivery id: 19, ... >\n有人知道如何保持原始顺序吗?
谢谢 !
\n