diff --git a/core/app/models/spree/shipping_manifest.rb b/core/app/models/spree/shipping_manifest.rb index 0d87fcbb4b0..7af71688391 100644 --- a/core/app/models/spree/shipping_manifest.rb +++ b/core/app/models/spree/shipping_manifest.rb @@ -21,9 +21,9 @@ def items states = {} units.group_by(&:state).each { |state, iu| states[state] = iu.count } - line_item = units.first.line_item - variant = units.first.variant - ManifestItem.new(line_item, variant, units.length, states) + first_unit = units.first + + ManifestItem.new(first_unit.line_item, first_unit.variant, units.length, states) end end.flatten end