Add comment to explain unusual fix

This commit is contained in:
Luis Ramos
2020-03-25 11:49:14 +00:00
parent 1cba129432
commit f1b64e90e0

View File

@@ -71,8 +71,10 @@ Spree::LineItem.class_eval do
where('spree_adjustments.id IS NULL')
}
# Overridden so that LineItems always have access to soft-deleted Variant attributes
# In some situations, unscoped super will be nil, in these cases we fetch the variant using the variant_id
# See isssue #4946 for more details
def variant
# Overridden so that LineItems always have access to soft-deleted Variant attributes
Spree::Variant.unscoped { super } || Spree::Variant.unscoped.find(self.variant_id)
end