From e15377b7d868efe71eff41eedd15f66143fe92f4 Mon Sep 17 00:00:00 2001 From: kikito Date: Sun, 25 Dec 2016 12:54:48 +0100 Subject: [PATCH] Load @assigned_heading in addition to loading @heading --- app/controllers/budgets/investments_controller.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/budgets/investments_controller.rb b/app/controllers/budgets/investments_controller.rb index 25425250f..490b4047d 100644 --- a/app/controllers/budgets/investments_controller.rb +++ b/app/controllers/budgets/investments_controller.rb @@ -89,7 +89,10 @@ module Budgets end def load_heading - @heading = @budget.headings.find(params[:heading_id]) if params[:heading_id].present? + if params[:heading_id].present? + @heading = @budget.headings.find(params[:heading_id]) + @assigned_heading = @ballot.try(:heading_for_group, @heading.try(:group)) + end end end