Fix private method called

```
Failure/Error: variant.stock_items.first.update_attribute(:count_on_hand, 10)

     NoMethodError:
       private method `count_on_hand=' called for #<Spree::StockItem:0x00005573998948a8>
       Did you mean?  count_on_hand
                      count_on_hand?
                      count_on_hand_was
     # ./spec/models/spree/variant_spec.rb:249:in `block (5 levels) in <module:Spree>'
     # -e:1:in `<main>'
```
This commit is contained in:
Matt-Yorkley
2021-01-10 10:55:11 +00:00
parent a8009d044b
commit 18a354ec1e

View File

@@ -41,12 +41,12 @@ module Spree
Spree::Variant.unscoped { super }
end
private
def count_on_hand=(value)
self[:count_on_hand] = value
end
private
def process_backorders
backordered_inventory_units.each do |unit|
break unless in_stock?