diff --git a/app/controllers/budgets/investments_controller.rb b/app/controllers/budgets/investments_controller.rb index 3953def8c..07434952d 100644 --- a/app/controllers/budgets/investments_controller.rb +++ b/app/controllers/budgets/investments_controller.rb @@ -20,6 +20,7 @@ module Budgets before_action :load_ballot, only: [:index, :show] before_action :load_heading, only: [:index, :show] + before_action :load_map, only: [:index] before_action :set_random_seed, only: :index before_action :load_categories, only: :index before_action :set_default_investment_filter, only: :index @@ -134,10 +135,8 @@ module Budgets if params[:heading_id].present? @heading = @budget.headings.find_by_slug_or_id! params[:heading_id] @assigned_heading = @ballot&.heading_for_group(@heading.group) - load_map elsif @budget.single_heading? @heading = @budget.headings.first - load_map end end @@ -180,7 +179,7 @@ module Budgets end def load_map - @map_location = MapLocation.load_from_heading(@heading) + @map_location = MapLocation.load_from_heading(@heading) if @heading.present? end end end