提交 21c0e0e8 编写于 作者: R Ryuta Kamizono

Remove single element array preprocess

Since 213796fb, array predicate handler supports making binds, so the
preprocess is no longer needed.
上级 c146065b
......@@ -105,7 +105,7 @@ def load_records(&block)
end
def records_for(ids, &block)
scope.where(association_key_name => ids.size == 1 ? ids.first : ids).load(&block)
scope.where(association_key_name => ids).load(&block)
end
def scope
......
......@@ -12,7 +12,7 @@ def queries
type_to_ids_mapping.map do |type, ids|
{
associated_table.association_foreign_type.to_s => type,
associated_table.association_foreign_key.to_s => ids.size > 1 ? ids : ids.first
associated_table.association_foreign_key.to_s => ids
}
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册