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:
luisramos0
2019-02-20 13:07:21 +00:00
parent 75a79717cf
commit ef786adcfc

View File

@@ -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)