Avoid subquery with too many columns error by specifying the selected column

This commit is contained in:
Luis Ramos
2020-02-23 20:02:20 +00:00
parent 1eba17f048
commit 03fac6f285

View File

@@ -63,7 +63,7 @@ class SubscriptionPlacementJob
end
def unavailable_stock_lines_for(order)
order.line_items.where('variant_id NOT IN (?)', available_variants_for(order))
order.line_items.where('variant_id NOT IN (?)', available_variants_for(order).select(&:id))
end
def available_variants_for(order)