Skip to content

Commit 394e83d

Browse files
committed
Remove guaranteed n+1 in line item option value condition
If we don't use pluck, we can preload.
1 parent f3e129c commit 394e83d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

promotions/app/models/solidus_promotions/conditions/line_item_option_value.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class LineItemOptionValue < Condition
1010

1111
def line_item_eligible?(line_item, _options = {})
1212
pid = line_item.product.id
13-
ovids = line_item.variant.option_values.pluck(:id)
13+
ovids = line_item.variant.option_value_ids
1414

1515
product_ids.include?(pid) && (value_ids(pid) & ovids).present?
1616
end

0 commit comments

Comments
 (0)