From 18a354ec1e0bc61ddaf00efb7590dd19b242fdbe Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Sun, 10 Jan 2021 10:55:11 +0000 Subject: [PATCH] Fix private method called ``` Failure/Error: variant.stock_items.first.update_attribute(:count_on_hand, 10) NoMethodError: private method `count_on_hand=' called for # 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 ' # -e:1:in `
' ``` --- app/models/spree/stock_item.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/spree/stock_item.rb b/app/models/spree/stock_item.rb index 3f43235296..56325c3bb5 100644 --- a/app/models/spree/stock_item.rb +++ b/app/models/spree/stock_item.rb @@ -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?