Skip to content

Commit

Permalink
🥗🧹 Tobias: Missed Trust#payouts relationship!
Browse files Browse the repository at this point in the history
  • Loading branch information
zspencer committed Feb 12, 2024
1 parent ee07e89 commit a0ee024
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/furniture/tobias/trust.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions spec/tobias/trust_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit a0ee024

Please sign in to comment.