mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-13 23:37:47 +00:00
Make variant_override.stock_overridden? simpler and add comment to explain relationship between count_on_hand and on_demand in a VO
This commit is contained in:
@@ -57,7 +57,9 @@ class VariantOverride < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def stock_overridden?
|
||||
on_demand == false && count_on_hand.present?
|
||||
# If count_on_hand is present, it means on_demand is false
|
||||
# See StockSettingsOverrideValidation for details
|
||||
count_on_hand.present?
|
||||
end
|
||||
|
||||
def decrement_stock!(quantity)
|
||||
|
||||
Reference in New Issue
Block a user