Create new FinancialLink for reverted FinancialTransaction

This commit is contained in:
Patrick Gansterer 2020-03-06 16:10:05 +01:00
parent 9b889dd643
commit 18e38be6be

View file

@ -29,6 +29,7 @@ class FinancialTransaction < ApplicationRecord
def revert!(user) def revert!(user)
transaction do transaction do
update_attribute :financial_link, FinancialLink.new
rt = dup rt = dup
rt.amount = -rt.amount rt.amount = -rt.amount
rt.reverts = self rt.reverts = self