From a589d8a76ddedca984bdf19c45a85e6669ae697b Mon Sep 17 00:00:00 2001 From: kikito Date: Fri, 23 Dec 2016 15:37:32 +0100 Subject: [PATCH] Simplifies ballot.add_investment using automatic denormalization --- app/models/budget/ballot.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/budget/ballot.rb b/app/models/budget/ballot.rb index 79aa56ce7..8f466936c 100644 --- a/app/models/budget/ballot.rb +++ b/app/models/budget/ballot.rb @@ -9,7 +9,7 @@ class Budget has_many :headings, -> { uniq }, through: :groups def add_investment(investment) - lines.create!(budget: budget, investment: investment, heading: investment.heading, group_id: investment.heading.group_id) + lines.create!(investment: investment) end def total_amount_spent