mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Add comment to explain unusual fix
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user