diff --git a/app/furniture/tobias/trust.rb b/app/furniture/tobias/trust.rb index d8dfbc071..357c690fd 100644 --- a/app/furniture/tobias/trust.rb +++ b/app/furniture/tobias/trust.rb @@ -3,5 +3,6 @@ class Trust < ApplicationRecord self.table_name = "tobias_trusts" has_many :beneficiaries, inverse_of: :trust, dependent: :destroy + has_many :payouts, inverse_of: :trust, dependent: :destroy end end diff --git a/spec/tobias/trust_spec.rb b/spec/tobias/trust_spec.rb index f0d61e935..1ae161b9b 100644 --- a/spec/tobias/trust_spec.rb +++ b/spec/tobias/trust_spec.rb @@ -4,4 +4,8 @@ describe "#benificiaries" do it { is_expected.to have_many(:beneficiaries).inverse_of(:trust).dependent(:destroy) } end + + describe "#payouts" do + it { is_expected.to have_many(:payouts).inverse_of(:trust).dependent(:destroy) } + end end