From 4bd5df4e0eb36479f175c1678cd5419602d2de4f Mon Sep 17 00:00:00 2001 From: Martin Artnik Date: Fri, 22 Apr 2022 10:49:42 +0200 Subject: [PATCH] Fix snapshot creation with stock consumption [SCI-6762] --- app/models/repository_stock_value.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/models/repository_stock_value.rb b/app/models/repository_stock_value.rb index caf07a9a2..8cf32736f 100644 --- a/app/models/repository_stock_value.rb +++ b/app/models/repository_stock_value.rb @@ -16,6 +16,8 @@ class RepositoryStockValue < ApplicationRecord validates :repository_cell, presence: true after_create do + next if is_a?(RepositoryStockConsumptionValue) + repository_ledger_records.create!(user: created_by, amount: amount, balance: amount,