Merge pull request #12961 from mkllnk/total-on-hand

Remove unused stock aggregation
This commit is contained in:
David Cook
2024-11-13 16:35:55 +11:00
committed by GitHub
2 changed files with 0 additions and 12 deletions

View File

@@ -211,10 +211,6 @@ module Spree
end
end
def total_on_hand
stock_items.sum(&:count_on_hand)
end
def properties_including_inherited
# Product properties override producer properties
ps = product_properties.all

View File

@@ -84,14 +84,6 @@ module Spree
end
end
describe '#total_on_hand' do
it 'returns sum of stock items count_on_hand' do
product = build(:product)
allow(product).to receive_messages stock_items: [double(Spree::StockItem, count_on_hand: 5)]
expect(product.total_on_hand).to eql(5)
end
end
context "has stock movements" do
let(:product) { create(:product) }
let(:variant) { product.variants.first }