Changed name enable_reset to resettable in Variant Overrides table & updated views, specs accordingly

This commit is contained in:
Steve Pettitt
2015-11-28 20:55:55 +00:00
committed by Rob Harrington
parent 25454d3e97
commit e423e890e0
11 changed files with 57 additions and 47 deletions

View File

@@ -56,7 +56,7 @@ class VariantOverride < ActiveRecord::Base
end
def reset_stock!
if enable_reset
if resettable
if default_stock?
self.attributes = { count_on_hand: default_stock }
self.save

View File

@@ -7,7 +7,7 @@ class VariantOverrideSet < ModelSet
attrs['price'].blank? &&
attrs['count_on_hand'].blank? &&
attrs['default_stock'].blank? &&
attrs['enable_reset'].blank? &&
attrs['resettable'].blank? &&
attrs['sku'].nil? &&
attrs['on_demand'].nil?
end