From ef786adcfce6bb37adf6777bf1bb3e4111413105 Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Wed, 20 Feb 2019 13:07:21 +0000 Subject: [PATCH] Make variant_override.stock_overridden? simpler and add comment to explain relationship between count_on_hand and on_demand in a VO --- app/models/variant_override.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/variant_override.rb b/app/models/variant_override.rb index cea630719b..a00caef367 100644 --- a/app/models/variant_override.rb +++ b/app/models/variant_override.rb @@ -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)